forked from oneapi-src/oneDAL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write Logistic Regression documentation (oneapi-src#2593)
* Initial commit * Add newton-cg optimizer * Create optimizers section * Write newton-cg and logreg documentation * Address comments * Join logloss.rst with index.rst
- Loading branch information
1 parent
1dfb4fc
commit 4c9a24c
Showing
17 changed files
with
522 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. ****************************************************************************** | ||
.. * Copyright 2023 Intel Corporation | ||
.. * | ||
.. * Licensed under the Apache License, Version 2.0 (the "License"); | ||
.. * you may not use this file except in compliance with the License. | ||
.. * You may obtain a copy of the License at | ||
.. * | ||
.. * http://www.apache.org/licenses/LICENSE-2.0 | ||
.. * | ||
.. * Unless required by applicable law or agreed to in writing, software | ||
.. * distributed under the License is distributed on an "AS IS" BASIS, | ||
.. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
.. * See the License for the specific language governing permissions and | ||
.. * limitations under the License. | ||
.. *******************************************************************************/ | ||
=================== | ||
Logistic Regression | ||
=================== | ||
|
||
This chapter describes programming interfaces of the Logistic Regression algorithm implemented in |short_name|. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
logistic-regression.rst |
143 changes: 143 additions & 0 deletions
143
docs/source/api/algorithms/logistic-regression/logistic-regression.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
.. ****************************************************************************** | ||
.. * Copyright 2023 Intel Corporation | ||
.. * | ||
.. * Licensed under the Apache License, Version 2.0 (the "License"); | ||
.. * you may not use this file except in compliance with the License. | ||
.. * You may obtain a copy of the License at | ||
.. * | ||
.. * http://www.apache.org/licenses/LICENSE-2.0 | ||
.. * | ||
.. * Unless required by applicable law or agreed to in writing, software | ||
.. * distributed under the License is distributed on an "AS IS" BASIS, | ||
.. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
.. * See the License for the specific language governing permissions and | ||
.. * limitations under the License. | ||
.. *******************************************************************************/ | ||
.. highlight:: cpp | ||
.. default-domain:: cpp | ||
|
||
.. _api_logreg: | ||
|
||
=================== | ||
Logistic Regression | ||
=================== | ||
|
||
.. include:: ../../../includes/logistic-regression/logistic-regression-introduction.rst | ||
|
||
------------------------ | ||
Mathematical formulation | ||
------------------------ | ||
|
||
Refer to :ref:`Developer Guide: Logistic Regression <alg_logreg>`. | ||
|
||
--------------------- | ||
Programming Interface | ||
--------------------- | ||
|
||
All types and functions are declared in the | ||
``oneapi::dal::logistic_regression`` namespace and available via the inclusion of the | ||
``oneapi/dal/algo/logistic_regression.hpp`` header file. | ||
|
||
Result Options | ||
-------------- | ||
.. onedal_class:: oneapi::dal::logistic_regression::result_option_id | ||
|
||
Descriptor | ||
---------- | ||
.. onedal_class:: oneapi::dal::logistic_regression::descriptor | ||
|
||
Method Tags | ||
~~~~~~~~~~~ | ||
.. onedal_tags_namespace:: oneapi::dal::logistic_regression::method | ||
|
||
Task Tags | ||
~~~~~~~~~ | ||
.. onedal_tags_namespace:: oneapi::dal::logistic_regression::task | ||
|
||
Model | ||
----- | ||
.. onedal_class:: oneapi::dal::logistic_regression::model | ||
|
||
|
||
.. _logreg_t_api: | ||
|
||
Training :cpp:expr:`train(...)` | ||
-------------------------------- | ||
|
||
.. _logreg_t_api_input: | ||
|
||
Input | ||
~~~~~ | ||
.. onedal_class:: oneapi::dal::logistic_regression::train_input | ||
|
||
.. _logreg_t_api_result: | ||
|
||
Result | ||
~~~~~~ | ||
.. onedal_class:: oneapi::dal::logistic_regression::train_result | ||
|
||
Operation | ||
~~~~~~~~~ | ||
|
||
.. function:: template <typename Descriptor> \ | ||
logistic_regression::train_result train(const Descriptor& desc, \ | ||
const logistic_regression::train_input& input) | ||
|
||
:param desc: Logistic Regression algorithm descriptor :expr:`logistic_regression::descriptor` | ||
:param input: Input data for the training operation | ||
|
||
Preconditions | ||
| :expr:`input.data.has_data == true` | ||
| :expr:`input.responses.data.has_data == true` | ||
| :expr:`input.data.row_count == input.responses.row_count` | ||
| :expr:`input.responses.column_count == 1` | ||
| :expr:`desc.inverse_regularization > 0.0` | ||
| :expr:`desc.class_count == 2` | ||
Postconditions | ||
| :expr:`result.coefficients.row_count = 1` | ||
| :expr:`result.coefficients.column_count = input.data.column_count` | ||
| :expr:`result.intercept.row_count = 1` | ||
| :expr:`result.intercept.column_count = 1` | ||
| :expr:`result.packed_coefficients.row_count = 1` | ||
| :expr:`result.packed_coefficients.column_count = input.data.column_count + 1` | ||
.. _logreg_i_api: | ||
|
||
Inference :cpp:expr:`infer(...)` | ||
--------------------------------- | ||
|
||
.. _logreg_i_api_input: | ||
|
||
Input | ||
~~~~~ | ||
.. onedal_class:: oneapi::dal::logistic_regression::infer_input | ||
|
||
.. _logreg_i_api_result: | ||
|
||
Result | ||
~~~~~~ | ||
.. onedal_class:: oneapi::dal::logistic_regression::infer_result | ||
|
||
Operation | ||
~~~~~~~~~ | ||
|
||
.. function:: template <typename Descriptor> \ | ||
logistic_regression::infer_result infer(const Descriptor& desc, \ | ||
const logistic_regression::infer_input& input) | ||
|
||
:param desc: Logistic Regression algorithm descriptor :expr:`logistic_regression::descriptor` | ||
:param input: Input data for the inference operation | ||
|
||
Preconditions | ||
| :expr:`input.data.has_data == true` | ||
Postconditions | ||
| :expr:`result.responses.column_count == 1` | ||
| :expr:`result.responses.row_count == input.data.row_count` | ||
|
||
-------- | ||
Examples | ||
-------- | ||
|
||
.. include:: ../../../includes/logistic-regression/logistic-regression-examples.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. ****************************************************************************** | ||
.. * Copyright 2023 Intel Corporation | ||
.. * | ||
.. * Licensed under the Apache License, Version 2.0 (the "License"); | ||
.. * you may not use this file except in compliance with the License. | ||
.. * You may obtain a copy of the License at | ||
.. * | ||
.. * http://www.apache.org/licenses/LICENSE-2.0 | ||
.. * | ||
.. * Unless required by applicable law or agreed to in writing, software | ||
.. * distributed under the License is distributed on an "AS IS" BASIS, | ||
.. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
.. * See the License for the specific language governing permissions and | ||
.. * limitations under the License. | ||
.. *******************************************************************************/ | ||
========== | ||
Optimizers | ||
========== | ||
|
||
This chapter describes the programming interfaces of optimizers implemented in |short_name|. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
newton-cg.rst |
Oops, something went wrong.