diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css index 597db0c3939..a3dd8b63ee2 100644 --- a/docs/source/_static/style.css +++ b/docs/source/_static/style.css @@ -4,7 +4,7 @@ .wy-table-responsive table td { /* !important prevents the common CSS stylesheets from overriding this as on RTD they are loaded after this stylesheet */ - + white-space: normal !important; } } diff --git a/docs/source/api/algorithms/index.rst b/docs/source/api/algorithms/index.rst index 4b2c933d0f4..911563a055d 100644 --- a/docs/source/api/algorithms/index.rst +++ b/docs/source/api/algorithms/index.rst @@ -27,7 +27,7 @@ Refer to :ref:`Developer Guide ` for mathematical descriptions of clustering/index.rst covariance/index.rst decomposition/index.rst - ensembles/index.rst + ensembles/index.rst kernel-functions/index.rst nearest-neighbors/index.rst pairwise-distances/index.rst diff --git a/docs/source/bibliography.rst b/docs/source/bibliography.rst index 03e946f3c95..1b247ab8e3e 100644 --- a/docs/source/bibliography.rst +++ b/docs/source/bibliography.rst @@ -24,19 +24,19 @@ For more information about algorithms implemented in |short_name|, refer to the .. [Adams2003] Adams, Robert A., and John JF Fournier. Sobolev spaces. Vol. 140. Elsevier, 2003 -.. [Agrawal94] +.. [Agrawal94] Rakesh Agrawal, Ramakrishnan Srikant. *Fast Algorithms for Mining Association Rules*. Proceedings of the 20th VLDB Conference Santiago, Chile, 1994. -.. [Arthur2007] +.. [Arthur2007] Arthur, D., Vassilvitskii, S. *k-means++: The Advantages of Careful Seeding*. Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms. Society for Industrial and Applied Mathematics Philadelphia, PA, USA, 2007, pp. 1027-1035. Available from http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf. -.. [Bahmani2012] +.. [Bahmani2012] B. Bahmani, B. Moseley, A. Vattani, R. Kumar, S. Vassilvitskii. *Scalable K-means++*. Proceedings of the VLDB Endowment, 2012. Available from @@ -56,39 +56,39 @@ For more information about algorithms implemented in |short_name|, refer to the BACON: blocked adaptive computationally efficient outlier nominators. Computational Statistics & Data Analysis, 34, 279-298, 2000. -.. [Bishop2006] +.. [Bishop2006] Christopher M. Bishop. *Pattern Recognition and Machine Learning*, p.198, Computational Statistics & Data Analysis, 34, 279-298, 2000. Springer Science+Business Media, LLC, ISBN-10: 0-387-31073-8, 2006. -.. [Boser92] +.. [Boser92] B. E. Boser, I. Guyon, and V. Vapnik. *A training algorithm for optimal marginclassifiers.*. Proceedings of the Fifth Annual Workshop on Computational Learning Theory, pp: 144–152, ACM Press, 1992. -.. [Breiman2001] +.. [Breiman2001] Leo Breiman. *Random Forests*. Machine Learning, Volume 45 Issue 1, pp. 5-32, 2001. -.. [Breiman84] +.. [Breiman84] Leo Breiman, Jerome H. Friedman, Richard A. Olshen, Charles J. Stone. *Classification and Regression Trees*. Chapman & Hall, 1984. -.. [Bro07] +.. [Bro07] Bro, R.; Acar, E.; Kolda, T.. *Resolving the sign ambiguity in the singular value decomposition*. SANDIA Report, SAND2007-6422, Unlimited Release, October, 2007. -.. [Byrd2015] +.. [Byrd2015] R. H. Byrd, S. L. Hansen, Jorge Nocedal, Y. Singer. *A Stochastic Quasi-Newton Method for Large-Scale Optimization*, 2015. arXiv:1401.7020v2 [math.OC]. Available from http://arxiv.org/abs/1401.7020v2. -.. [Chen2016] +.. [Chen2016] T. Chen, C. Guestrin. *XGBoost: A Scalable Tree Boosting System*, KDD '16 Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. @@ -102,7 +102,7 @@ For more information about algorithms implemented in |short_name|, refer to the J. W. Demmel and W. Kahan. *Accurate singular values of bidiagonal matrices*. SIAM J. Sci. Stat. Comput., 11 (1990), pp. 873-912. -.. [Dempster77] +.. [Dempster77] A.P.Dempster, N.M. Laird, and D.B. Rubin. *Maximum-likelihood from incomplete data via the em algorithm*. J. Royal Statist. Soc. Ser. B., 39, 1977. @@ -118,7 +118,7 @@ For more information about algorithms implemented in |short_name|, refer to the In Proceedings of the 2nd ACM International Conference on Knowledge Discovery and Data Mining (KDD). 226-231, 1996. -.. [Fan05] +.. [Fan05] Rong-En Fan, Pai-Hsuen Chen, Chih-Jen Lin. *Working Set Selection Using Second Order Information for Training Support Vector Machines.*. Journal of Machine Learning Research 6 (2005), pp: @@ -129,12 +129,12 @@ For more information about algorithms implemented in |short_name|, refer to the Algorithmic Aspects in Information and Management. 4th International conference, AAIM 2008, Shanghai, China, June 23-25, 2008. Proceedings, Springer. -.. [Freund99] +.. [Freund99] Yoav Freund, Robert E. Schapire. *Additive Logistic regression: a statistical view of boosting*. Journal of Japanese Society for Artificial Intelligence (14(5)), 771-780, 1999. -.. [Friedman98] +.. [Friedman98] Friedman, Jerome H., Trevor J. Hastie and Robert Tibshirani. *Additive Logistic Regression: a Statistical View of Boosting.*. 1998. @@ -144,12 +144,12 @@ For more information about algorithms implemented in |short_name|, refer to the Additive Logistic regression: a statistical view of boosting. The Annals of Statistics, 28(2), pp: 337-407, 2000. -.. [Friedman2010] +.. [Friedman2010] Friedman, Jerome, Trevor Hastie, and Rob Tibshirani. *Regularization paths for generalized linear models via coordinate descent.*. Journal of statistical software 33.1 (2010): 1. -.. [Friedman2017] +.. [Friedman2017] Jerome Friedman, Trevor Hastie, Robert Tibshirani. 2017. *The Elements of Statistical Learning Data Mining, Inference, and Prediction.* Springer. @@ -161,18 +161,18 @@ For more information about algorithms implemented in |short_name|, refer to the .. [Gross2014] J. Gross, J. Yellen, P. Zhang, Handbook of Graph Theory, Second Edition, 2014. -.. [Hastie2009] +.. [Hastie2009] Trevor Hastie, Robert Tibshirani, Jerome Friedman. *The Elements of Statistical Learning: Data Mining, Inference, and Prediction*. Second Edition (Springer Series in Statistics), Springer, 2009. Corr. 7th printing 2013 edition (December 23, 2011). -.. [Hoerl70] +.. [Hoerl70] Arthur E. Hoerl and Robert W. Kennard. *Ridge Regression: Biased Estimation for Nonorthogonal Problems*. Technometrics, Vol. 12, No. 1 (Feb., 1970), pp. 55-67. -.. [Hsu02] +.. [Hsu02] Chih-Wei Hsu and Chih-Jen Lin. *A Comparison of Methods for Multiclass Support Vector Machines*. IEEE Transactions on Neural Networks, Vol. 13, No. 2, pp: 415-425, 2002. @@ -182,13 +182,13 @@ For more information about algorithms implemented in |short_name|, refer to the Collaborative Filtering for Implicit Feedback Datasets. ICDM'08. Eighth IEEE International Conference, 2008. -.. [James2013] +.. [James2013] Gareth James, Daniela Witten, Trevor Hastie, and Rob Tibshirani. *An Introduction to Statistical Learning with Applications in R*. Springer Series in Statistics, Springer, 2013 (Corrected at 6\ :sup:`th` printing 2015). -.. [Joachims99] +.. [Joachims99] Thorsten Joachims. *Making Large-Scale SVM Learning Practical*. Advances in Kernel Methods - Support Vector Learning, B. Schölkopf, C. Burges, and A. Smola (ed.), pp: 169 – 184, MIT Press @@ -198,12 +198,12 @@ For more information about algorithms implemented in |short_name|, refer to the S. Lang. *Linear Algebra*. Springer-Verlag New York, 1987. .. [Li2015] - Li, Shengren, and Nina Amenta. + Li, Shengren, and Nina Amenta. "Brute-force k-nearest neighbors search on the GPU." In International Conference on Similarity Search and Applications, pp. 259-270. Springer, Cham, 2015. -.. [Lloyd82] +.. [Lloyd82] Stuart P Lloyd. *Least squares quantization in PCM*. IEEE Transactions on Information Theory 1982, 28 (2): 1982pp: 129–137. @@ -219,10 +219,10 @@ For more information about algorithms implemented in |short_name|, refer to the 1998, Ed. Niederreiter, H. and Spanier, J., Springer 2000, pp. 56-69, available from http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/DC/dc.html. -.. [Mitchell97] +.. [Mitchell97] Tom M. Mitchell. *Machine Learning*. McGraw-Hill Education, 1997. -.. [Mu2014] +.. [Mu2014] Mu Li, Tong Zhang, Yuqiang Chen, Alexander J. Smola. *Efficient Mini-batch Training for Stochastic Optimization*, 2014. Available from https://www.cs.cmu.edu/~muli/file/minibatch_sgd.pdf. @@ -232,7 +232,7 @@ For more information about algorithms implemented in |short_name|, refer to the Version:2.1 Document Revision:24 Available from `opencl-2.1.pdf `_ -.. [Patwary2016] +.. [Patwary2016] Md. Mostofa Ali Patwary, Nadathur Rajagopalan Satish, Narayanan Sundaram, Jialin Liu, Peter Sadowski, Evan Racah, Suren Byna, Craig Tull, Wahid Bhimji, Prabhat, Pradeep Dubey. *PANDA: Extreme @@ -248,21 +248,21 @@ For more information about algorithms implemented in |short_name|, refer to the A fast algorithm for training support vector machines." (1998). Available from https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-98-14.pdf. -.. [Quinlan86] +.. [Quinlan86] J. R. Quinlan. *Induction of Decision Trees*. Machine Learning, Volume 1 Issue 1, pp. 81-106, 1986. -.. [Quinlan87] +.. [Quinlan87] J. R. Quinlan. *Simplifying decision trees*. International journal of Man-Machine Studies, Volume 27 Issue 3, pp. 221-234, 1987. -.. [Renie03] +.. [Renie03] Jason D.M. Rennie, Lawrence, Shih, Jaime Teevan, David R. Karget. *Tackling the Poor Assumptions of Naïve Bayes Text classifiers*. Proceedings of the Twentieth International Conference on Machine Learning (ICML-2003), Washington DC, 2003. -.. [Rumelhart86] +.. [Rumelhart86] David E. Rumelhart, Geoffrey E. Hinton, Ronald J. Williams. *Learning representations by back-propagating errors*. Nature (323), pp. 533-536, 1986. @@ -277,7 +277,7 @@ For more information about algorithms implemented in |short_name|, refer to the integrates OpenCL™ devices with modern C++, Version 1.2.1 Available from `sycl-1.2.1.pdf `_ -.. [Tan2005] +.. [Tan2005] Pang-Ning Tan, Michael Steinbach, Vipin Kumar, Introduction to Data Mining, (First Edition) Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 2005, ISBN: 032132136. @@ -291,13 +291,13 @@ For more information about algorithms implemented in |short_name|, refer to the .. [Wen2018] Wen, Zeyi, Jiashuai Shi, Qinbin Li, Bingsheng He, and Jian Chen. ThunderSVM: A fast SVM library on GPUs and CPUs. - The Journal of Machine Learning Research, 19, 1-5 (2018). + The Journal of Machine Learning Research, 19, 1-5 (2018). -.. [Wu04] +.. [Wu04] Ting-Fan Wu, Chih-Jen Lin, Ruby C. Weng. *Probability Estimates for Multi-class Classification by Pairwise Coupling*. Journal of Machine Learning Research 5, pp: 975-1005, 2004. -.. [Zhu2005] +.. [Zhu2005] Zhu, Ji, Hui Zou, Saharon Rosset and Trevor J. Hastie. *Multi-class AdaBoost*. 2005 diff --git a/docs/source/daal/algorithms/association_rules/association-rules.rst b/docs/source/daal/algorithms/association_rules/association-rules.rst index a1b56505199..1da402e3140 100644 --- a/docs/source/daal/algorithms/association_rules/association-rules.rst +++ b/docs/source/daal/algorithms/association_rules/association-rules.rst @@ -73,7 +73,9 @@ The association rules algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Association Rules (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -93,10 +95,13 @@ Algorithm Parameters The association rules algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Association Rules (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -151,10 +156,13 @@ The association rules algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Association Rules (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result @@ -163,28 +171,28 @@ the results of your algorithm. the table equals the number of items in the large item sets. Each row contains two integers: - + ID of the large item set, the number between 0 and nLargeItemsets -1. - + ID of the item, the number between 0 and :math:`nUniqueItems-1`. + + ID of the large item set, the number between 0 and nLargeItemsets -1. + + ID of the item, the number between 0 and :math:`nUniqueItems-1`. * - ``largeItemsetsSupport`` - Pointer to the :math:`nLargeItemsets \times 2` numeric table of support values. Each row contains two integers: - + ID of the large item set, the number between 0 and nLargeItemsets-1. - + The support value, the number of times the item set is met in the array of transactions. + + ID of the large item set, the number between 0 and nLargeItemsets-1. + + The support value, the number of times the item set is met in the array of transactions. * - ``antecedentItemsets`` - Pointer to the :math:`nAntecedentItems \times 2` numeric table that contains the left-hand-side (X) part of the association rules. Each row contains two integers: - + Rule ID, the number between 0 and :math:`nAntecedentItems-1`. - + Item ID, the number between 0 and :math:`nUniqueItems-1`. + + Rule ID, the number between 0 and :math:`nAntecedentItems-1`. + + Item ID, the number between 0 and :math:`nUniqueItems-1`. * - ``conseqentItemsets`` - Pointer to the :math:`nConsequentItems \times 2` numeric table that contains the right-hand-side (Y) part of the association rules. Each row contains two integers: - + Rule ID, the number between 0 and :math:`nConsequentItems-1`. - + Item ID, the number between 0 and :math:`nUniqueItems-1`. + + Rule ID, the number between 0 and :math:`nConsequentItems-1`. + + Item ID, the number between 0 and :math:`nUniqueItems-1`. * - ``confidence`` - Pointer to the :math:`nRules \times 1` numeric table that contains confidence values @@ -224,7 +232,7 @@ Examples - :cpp_example:`assoc_rules_apriori_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -234,7 +242,7 @@ Examples .. tab:: Python* Batch Processing: - + - :daal4py_example:`association_rules_batch.py` Performance Considerations diff --git a/docs/source/daal/algorithms/boosting/adaboost-multiclass.rst b/docs/source/daal/algorithms/boosting/adaboost-multiclass.rst index 8be2d856d79..872ead1f017 100644 --- a/docs/source/daal/algorithms/boosting/adaboost-multiclass.rst +++ b/docs/source/daal/algorithms/boosting/adaboost-multiclass.rst @@ -28,10 +28,10 @@ Details ******* Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots x_n = (x_{n1}, \ldots, x_{np})` -of size :math:`p`, a vector of class labels :math:`y = (y_1, \ldots, y_n)` +of size :math:`p`, a vector of class labels :math:`y = (y_1, \ldots, y_n)` where :math:`y_i \in K = \{-1, 1\}` in case of binary classification and :math:`y_i \in K = \{ 0, \ldots, C-1 \}`, where :math:`C` is a number of classes, -describes the class :math:`t` the feature vector :math:`x_i` belongs to, +describes the class :math:`t` the feature vector :math:`x_i` belongs to, and :math:`h_t` is a weak learner algorithm, the problem is to build an AdaBoost classifier. Training Stage @@ -65,10 +65,10 @@ Training Stage #. Initialize weights :math:`D_1(i) = \frac{1}{n}` for :math:`i = 1, \ldots, n` #. For :math:`t = 1, \ldots, T`: - + - Train the weak learner :math:`h_t(i)` using weights :math:`D_t`. - Receive the weighed class probability estimates from weak learner: - + .. math:: p_k^t(x) = \mathrm{Prob}_w \{ c = k | x\}, k = 0, \ldots, C-1 @@ -89,7 +89,7 @@ Training Stage :math:`z_{ik} = \begin{cases} 1, & k = y_i \\ - \frac{1}{K-1}, & k \neq y_i \end{cases}` - #. Output the final hypothesis: + #. Output the final hypothesis: .. math:: H(x) = \underset{k} {\mathrm{argmax}} \sum_{t=1}^{T} s_k^t(x) @@ -128,10 +128,13 @@ Training For a description of the input and output, refer to :ref:`classification_usage_model`. At the training stage, an AdaBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for AdaBoost Multiclass Classifier (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -172,11 +175,13 @@ At the training stage, an AdaBoost classifier has the following parameters: Output ------ -In addition to classifier output, AdaBoostcalculates the result described below. +In addition to classifier output, AdaBoost calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the result of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for AdaBoost Multiclass Classifier (Batch Processing) :header-rows: 1 :widths: 10 60 :align: left @@ -186,7 +191,7 @@ For more details, see :ref:`algorithms`. * - ``weakLearnersErrors`` - A numeric table :math:`1 \times \mathrm{maxIterations}` containing weak learner's classification errors computed when the ``computeWeakLearnersErrors`` option is on. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable``. @@ -197,10 +202,13 @@ Prediction For a description of the input and output, refer to :ref:`classification_usage_model`. At the prediction stage, an AdaBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for AdaBoost Multiclass Classifier (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -234,7 +242,7 @@ Examples - :cpp_example:`adaboost_sammer_multi_class_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/boosting/adaboost.rst b/docs/source/daal/algorithms/boosting/adaboost.rst index 9822e2b3fde..e43526bfbd9 100644 --- a/docs/source/daal/algorithms/boosting/adaboost.rst +++ b/docs/source/daal/algorithms/boosting/adaboost.rst @@ -26,7 +26,7 @@ For a multi-class case, use :ref:`svm_multi_class` framework of the library. Details ******* -Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` +Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` and a vector of class labels :math:`y= (y_1, \ldots, y_n)`, where :math:`y_i \in K = \{-1, 1\}` describes the class to which the feature vector :math:`x_i` belongs, and a weak learner algorithm, the problem is to build an AdaBoost classifier. @@ -47,7 +47,7 @@ The following scheme shows the major steps of the algorithm: #. Output the final hypothesis: .. math:: - H(x_i) = \mathrm{sign} \left( \sum _{t=1}^{T} \alpha_t h_t(x_i)\right) + H(x_i) = \mathrm{sign} \left( \sum _{t=1}^{T} \alpha_t h_t(x_i)\right) Prediction Stage ---------------- @@ -69,10 +69,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the training stage, an AdaBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for AdaBoost Classifier (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -104,10 +107,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the prediction stage, an AdaBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for AdaBoost Classifier (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -120,7 +126,7 @@ At the prediction stage, an AdaBoost classifier has the following parameters: - Performance-oriented computation method, the only method supported by the AdaBoost classifier at the prediction stage. * - ``weakLearnerPrediction`` - Pointer to an object of the stump prediction class - - Pointer to the prediction algorithm of the weak learner. By default, a stump weak learner is used. + - Pointer to the prediction algorithm of the weak learner. By default, a stump weak learner is used. Examples ******** @@ -134,7 +140,7 @@ Examples - :cpp_example:`adaboost_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/boosting/brownboost.rst b/docs/source/daal/algorithms/boosting/brownboost.rst index 530785fe78f..ca2dfdabc4f 100644 --- a/docs/source/daal/algorithms/boosting/brownboost.rst +++ b/docs/source/daal/algorithms/boosting/brownboost.rst @@ -26,7 +26,7 @@ For a multi-class case, use :ref:`svm_multi_class` framework of the library. Details ******* -Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` +Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` and a vector of class labels :math:`y= (y_1, \ldots, y_n)`, where :math:`y_i \in K = \{-1, 1\}` describes the class to which the feature vector :math:`x_i` belongs, and a weak learner algorithm, the problem is to build a two-class BrownBoost classifier. @@ -41,17 +41,17 @@ The model is trained using the Freund method [Freund01]_ as follows: - :math:`\mathrm{erfinv}(x)` is an inverse error function, - :math:`\varepsilon` is a target classification error of the algorithm defined as :math:`\frac {1}{n} \sum _{i=1}^{n} |p(x_i) - y_i|` - - :math:`p(x) = \text{erf} \left(\frac {\sum _{i=1}^{M} \alpha_i h_i(x)}{\sqrt{c}}\right)` + - :math:`p(x) = \text{erf} \left(\frac {\sum _{i=1}^{M} \alpha_i h_i(x)}{\sqrt{c}}\right)` - :math:`\mathrm{erf}(x)` is the error function, - :math:`h_i(x)` is a hypothesis formulated by the :math:`i`-th weak learner, :math:`i = 1, \ldots, M`, - - :math:`\alpha_i` is the weight of the hypothesis. + - :math:`\alpha_i` is the weight of the hypothesis. #. Set initial prediction values: :math:`r_1(x, y) = 0`. #. Set "remaining timing": :math:`s_1 = c`. #. Do for :math:`i=1, 2, \ldots` until :math:`s_{i+1} \leq 0` #. With each feature vector and its label of positive weight, associate :math:`W_i(x, y) = e^{\frac {-(r_i(x, y) + s_i)^2}{c}}`. #. Call the weak learner with the distribution defined by normalizing Lmath:`W_i(x, y)` to receive a hypothesis :math:`h_i(x)`. - #. Solve the differential equation + #. Solve the differential equation .. math:: \frac {dt}{d\alpha} = \gamma = @@ -71,7 +71,7 @@ The result of the model training is the array of :math:`M` weak learners :math:` Prediction Stage ---------------- -Given the BrownBoost classifier and :math:`r` feature vectors :math:`x_1, \ldots, x_r`, +Given the BrownBoost classifier and :math:`r` feature vectors :math:`x_1, \ldots, x_r`, the problem is to calculate the final classification confidence, a number from the interval :math:`[-1, 1]`, using the rule: .. math:: @@ -89,10 +89,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the training stage, a BrownBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for BrownBoost Classifier (Batch Processing) :header-rows: 1 - :widths: 10 20 30 + :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -143,10 +146,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the prediction stage, a BrownBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for BrownBoost Classifier (Batch Processing) :header-rows: 1 - :widths: 10 20 30 + :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -183,7 +189,7 @@ Examples - :cpp_example:`brownboost_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/boosting/index.rst b/docs/source/daal/algorithms/boosting/index.rst index 031fc93ef76..3d053c73376 100644 --- a/docs/source/daal/algorithms/boosting/index.rst +++ b/docs/source/daal/algorithms/boosting/index.rst @@ -22,7 +22,7 @@ by iterative re-weighting according to some accuracy measure for weak learners. A weak learner is a classification or regression algorithm that has only slightly better performance than random guessing. Weak learners are usually very simple and fast, and they focus on classification of very specific features. -Boosting algorithms include LogitBoost, BrownBoost, AdaBoost, and others. +Boosting algorithms include LogitBoost, BrownBoost, AdaBoost, and others. A Decision Stump classifier is one of the popular weak learners. In |short_name|, a weak learner is: @@ -46,7 +46,7 @@ You can implement your own weak learners by deriving from the appropriate interf - The number from :math:`\{-1, 1\}` in case of binary classification. - Class label from :math:`\{0, \ldots, \text{nClasses}-1\}` for ``nClasses`` > 2. - - Some boosting algorithms like SAMME.R AdaBoost that require probabilities of classes. + - Some boosting algorithms like SAMME.R AdaBoost that require probabilities of classes. For description of each boosting algorithm, refer to a corresponding section in this document. .. toctree:: diff --git a/docs/source/daal/algorithms/boosting/logitboost.rst b/docs/source/daal/algorithms/boosting/logitboost.rst index 42c279f0811..b0f7271a884 100644 --- a/docs/source/daal/algorithms/boosting/logitboost.rst +++ b/docs/source/daal/algorithms/boosting/logitboost.rst @@ -26,9 +26,9 @@ LogitBoost within |short_name| implements a multi-class classifier. Details ******* -Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` +Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of size :math:`p` and a vector of class labels :math:`y= (y_1, \ldots, y_n)`, where :math:`y_i \in K = \{0, \ldots, J-1\}` -describes the class to which the feature vector :math:`x_i` belongs and :math:`J` is the number of classes, +describes the class to which the feature vector :math:`x_i` belongs and :math:`J` is the number of classes, the problem is to build a multi-class LogitBoost classifier. Training Stage @@ -43,7 +43,7 @@ The scheme below, which uses the stump weak learner, shows the major steps of th #. For :math:`m = 1, \ldots, M`: Do - + For :math:`j = 1, \ldots, J` Do @@ -59,7 +59,7 @@ The scheme below, which uses the stump weak learner, shows the major steps of th #. Fit the function :math:`f_{mj}(x)` by a weighted least-squares regression of :math:`z_{ij}` to :math:`x_i` with weights :math:`w_{ij}` using the stump-based approach. - End do + End do :math:`f_{mj}(x) = \frac {J-1}{J} (f_{mj}(x) - \frac{1}{J} \sum _{k=1}^{J} f_{mk}(x))` @@ -90,10 +90,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the training stage, a LogitBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for LogitBoost Classifier (Batch Processing) :header-rows: 1 - :widths: 10 20 30 + :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -141,10 +144,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the prediction stage, a LogitBoost classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for LogitBoost Classifier (Batch Processing) :header-rows: 1 - :widths: 10 20 30 + :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -184,7 +190,7 @@ Examples - :cpp_example:`logitboost_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/cholesky/cholesky.rst b/docs/source/daal/algorithms/cholesky/cholesky.rst index 51a64c73a90..b4b9622ebd7 100644 --- a/docs/source/daal/algorithms/cholesky/cholesky.rst +++ b/docs/source/daal/algorithms/cholesky/cholesky.rst @@ -37,11 +37,13 @@ Batch Processing Algorithm Input --------------- -Cholesky decomposition accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Cholesky decomposition accepts the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Cholesky Decomposition (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -59,9 +61,11 @@ Algorithm Parameters Cholesky decomposition has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Cholesky Decomposition (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left * - Parameter @@ -77,11 +81,13 @@ Cholesky decomposition has the following parameters: Algorithm Output ---------------- -Cholesky decomposition calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +Cholesky decomposition calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Cholesky Decomposition (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -89,7 +95,7 @@ For more details, see :ref:`algorithms`. - Result * - ``choleskyFactor`` - Pointer to the :math:`p \times p` numeric table that represents the lower triangular matrix :math:`L` (Cholesky factor). - + By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``СSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``upperPackedTriangularMatrix`` layout. @@ -106,11 +112,11 @@ Examples - :cpp_example:`cholesky_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`CholeskyDenseBatch.java ` .. tab:: Python* diff --git a/docs/source/daal/algorithms/covariance/computation-batch.rst b/docs/source/daal/algorithms/covariance/computation-batch.rst index 6062ff5bdd6..35a1d0459eb 100644 --- a/docs/source/daal/algorithms/covariance/computation-batch.rst +++ b/docs/source/daal/algorithms/covariance/computation-batch.rst @@ -24,7 +24,9 @@ The correlation and variance-covariance matrices algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Correlation and Variance-Covariance Matrices Algorithm (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 @@ -44,10 +46,13 @@ Algorithm Parameters The correlation and variance-covariance matrices algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Correlation and Variance-Covariance Matrices Algorithm (Batch Processing) :header-rows: 1 :align: left :widths: 10 20 30 + :class: longtable * - Parameter - Default Value @@ -91,19 +96,22 @@ The correlation and variance-covariance matrices algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Correlation and Variance-Covariance Matrices Algorithm (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 + :class: longtable * - Result ID - Result * - ``covariance`` - Use when outputMatrixType=covarianceMatrix. Pointer to the numeric table with the :math:`p \times p` variance-covariance matrix. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. @@ -112,15 +120,15 @@ methods that access the results of your algorithm. table with the :math:`p \times p` correlation matrix. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. * - ``mean`` - Pointer to the :math:`1 \times p` numeric table with means. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/covariance/computation-distributed.rst b/docs/source/daal/algorithms/covariance/computation-distributed.rst index e6a55789627..54668f85f4b 100644 --- a/docs/source/daal/algorithms/covariance/computation-distributed.rst +++ b/docs/source/daal/algorithms/covariance/computation-distributed.rst @@ -26,9 +26,12 @@ Algorithm Parameters The correlation and variance-covariance matrices algorithm in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Correlation and Variance-Covariance Matrices Algorithm (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -47,26 +50,26 @@ The correlation and variance-covariance matrices algorithm in the distributed pr - ``defaultDense`` - Available methods for computation of low order moments: - defaultDense - default performance-oriented method + defaultDense + default performance-oriented method - singlePassDense - implementation of the single-pass algorithm proposed by D.H.D. West + singlePassDense + implementation of the single-pass algorithm proposed by D.H.D. West - sumDense - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined + sumDense + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined - fastCSR - performance-oriented method for CSR numeric tables + fastCSR + performance-oriented method for CSR numeric tables - singlePassCSR - implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables + singlePassCSR + implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables - sumCSR - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; optimized for CSR numeric tables; - returns an error if pre-computed sums are not defined + sumCSR + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; optimized for CSR numeric tables; + returns an error if pre-computed sums are not defined * - ``outputMatrixType`` - ``covarianceMatrix`` @@ -85,15 +88,17 @@ In this step, the correlation and variance-covariance matrices algorithm accepts Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Step 1: Algorithm Input for Correlation and Variance-Covariance Matrices Algorithm (Distributed Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n_i \times p` that represents the :math:`i`-th data block on the local node. - + - Pointer to the numeric table of size :math:`n_i \times p` that represents the :math:`i`-th data block on the local node. + While the input for ``defaultDense``, ``singlePassDense``, or ``sumDense`` method can be an object of any class derived from ``NumericTable``, the input for ``fastCSR``, ``singlePassCSR``, or ``sumCSR`` method can only be an object of the ``CSRNumericTable`` class. @@ -102,33 +107,36 @@ In this step, the correlation and variance-covariance matrices algorithm calcula Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Step 1: Algorithm Output for Correlation and Variance-Covariance Matrices Algorithm (Distributed Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservations`` - Pointer to the :math:`1 \times 1` numeric table that contains the number of observations processed so far on the local node. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``crossProduct`` - Pointer to :math:`p \times p` numeric table with the cross-product matrix computed so far on the local node. - + .. note:: - + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``sum`` - Pointer to :math:`1 \times p` numeric table with partial sums computed so far on the local node. - + .. note:: - + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -141,7 +149,9 @@ In this step, the correlation and variance-covariance matrices algorithm accepts Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Step 2: Algorithm Input for Correlation and Variance-Covariance Matrices Algorithm (Distributed Processing) :widths: 10 60 :header-rows: 1 @@ -149,9 +159,9 @@ For more details, see :ref:`algorithms`. - Input * - ``partialResults`` - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``nObservations``, ``crossProduct``, and ``sum``). - + .. note:: - + The collection can contain objects of any class derived from the ``NumericTable`` class except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. @@ -159,33 +169,36 @@ In this step, the correlation and variance-covariance matrices algorithm calcula Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Step 2: Algorithm Output for for Correlation and Variance-Covariance Matrices Algorithm (Distributed Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``covariance`` - - Use when ``outputMatrixType``=``covarianceMatrix``. Pointer to the numeric table with the :math:`p \times p` variance-covariance matrix. - + - Use when ``outputMatrixType``=``covarianceMatrix``. Pointer to the numeric table with the :math:`p \times p` variance-covariance matrix. + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. * - ``correlation`` - Use when ``outputMatrixType``=``correlationMatrix``. Pointer to the numeric table with the :math:`p \times p` correlation matrix. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. * - ``mean`` - Pointer to the :math:`1 \times p` numeric table with means. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/covariance/computation-online.rst b/docs/source/daal/algorithms/covariance/computation-online.rst index 890cf516e73..11877a78e1e 100644 --- a/docs/source/daal/algorithms/covariance/computation-online.rst +++ b/docs/source/daal/algorithms/covariance/computation-online.rst @@ -31,15 +31,17 @@ The correlation and variance-covariance matrices algorithm in the online process Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Correlation and Variance-Covariance Matrices Algorithm (Online Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n_i \times p` that represents the current data block. - + - Pointer to the numeric table of size :math:`n_i \times p` that represents the current data block. + While the input for ``defaultDense``, ``singlePassDense``, or ``sumDense`` method can be an object of any class derived from ``NumericTable``, the input for ``fastCSR``, ``singlePassCSR``, or ``sumCSR`` method can only be an object of the ``CSRNumericTable`` class. @@ -49,9 +51,12 @@ Algorithm Parameters The correlation and variance-covariance matrices algorithm has the following parameters in the online processing mode: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for for Correlation and Variance-Covariance Matrices Algorithm (Online Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -63,26 +68,26 @@ The correlation and variance-covariance matrices algorithm has the following par - ``defaultDense`` - Available methods for computation of correlation and variance-covariance matrices: - defaultDense - default performance-oriented method + defaultDense + default performance-oriented method - singlePassDense - implementation of the single-pass algorithm proposed by D.H.D. West + singlePassDense + implementation of the single-pass algorithm proposed by D.H.D. West - sumDense - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined + sumDense + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined - fastCSR - performance-oriented method for CSR numeric tables + fastCSR + performance-oriented method for CSR numeric tables - singlePassCSR - implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables + singlePassCSR + implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables - sumCSR - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; optimized for CSR numeric tables; - returns an error if pre-computed sums are not defined + sumCSR + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; optimized for CSR numeric tables; + returns an error if pre-computed sums are not defined * - ``outputMatrixType`` - ``covarianceMatrix`` @@ -103,33 +108,36 @@ The correlation and variance-covariance matrices algorithm in the online process Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for Correlation and Variance-Covariance Matrices Algorithm (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservations`` - Pointer to the :math:`1 \times 1` numeric table that contains the number of observations processed so far. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``crossProduct`` - Pointer to :math:`p \times p` numeric table with the cross-product matrix computed so far. - + .. note:: - + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``sum`` - Pointer to :math:`1 \times p` numeric table with partial sums computed so far. - + .. note:: - + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -141,33 +149,36 @@ The correlation and variance-covariance matrices algorithm calculates the result Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Correlation and Variance-Covariance Matrices Algorithm (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``covariance`` - - Use when ``outputMatrixType``=``covarianceMatrix``. Pointer to the numeric table with the :math:`p \times p` variance-covariance matrix. - + - Use when ``outputMatrixType``=``covarianceMatrix``. Pointer to the numeric table with the :math:`p \times p` variance-covariance matrix. + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. * - ``correlation`` - Use when ``outputMatrixType``=``correlationMatrix``. Pointer to the numeric table with the :math:`p \times p` correlation matrix. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. * - ``mean`` - Pointer to the :math:`1 \times p` numeric table with means. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/covariance/correlation-and-variance-covariance-matrices.rst b/docs/source/daal/algorithms/covariance/correlation-and-variance-covariance-matrices.rst index e623e4ad7e9..bebd5857778 100644 --- a/docs/source/daal/algorithms/covariance/correlation-and-variance-covariance-matrices.rst +++ b/docs/source/daal/algorithms/covariance/correlation-and-variance-covariance-matrices.rst @@ -44,9 +44,12 @@ Given a set :math:`X` of :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, dimension :math:`p`, the problem is to compute the sample means and variance-covariance matrix or correlation matrix: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Correlation and Variance-Covariance Matrices :widths: 10 60 :header-rows: 1 + :class: longtable * - Statistic - Definition @@ -64,7 +67,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-online.rst computation-distributed.rst @@ -82,7 +85,7 @@ Examples - :cpp_example:`cov_csr_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -100,7 +103,7 @@ Examples - :daal4py_sycl_example:`covariance_streaming.py` - .. tab:: Python* + .. tab:: Python* Batch Processing: diff --git a/docs/source/daal/algorithms/dbscan/computation-batch.rst b/docs/source/daal/algorithms/dbscan/computation-batch.rst index 647a7290ce5..78f9b8171b9 100644 --- a/docs/source/daal/algorithms/dbscan/computation-batch.rst +++ b/docs/source/daal/algorithms/dbscan/computation-batch.rst @@ -17,18 +17,17 @@ Batch Processing ================ -- `Algorithm Parameters`_ -- `Algorithm Input`_ -- `Algorithm Output`_ - Algorithm Parameters ******************** The DBSCAN clustering algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Batch Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -51,17 +50,17 @@ The DBSCAN clustering algorithm has the following parameters: * - ``memorySavingMode`` - ``false`` - If flag is set to false, all neighborhoods will be computed and stored prior to clustering. - It will require up to :math:`O(|\text{sum of sizes of all observations' neighborhoods}|)` of additional memory, + It will require up to :math:`O(|\text{sum of sizes of all observations' neighborhoods}|)` of additional memory, which in worst case can be :math:`O(|\text{number of observations}|^2)`. However, in general, performance may be better. - .. note:: + .. note:: On GPU, the ``memorySavingMode`` flag can only be set to ``true``. You will get an error if the flag is set to ``false``. * - ``resultsToCompute`` - :math:`0` - The 64-bit integer flag that specifies which extra characteristics of the DBSCAN algorithm to compute. - + Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics: @@ -75,9 +74,12 @@ The DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -90,10 +92,10 @@ For more details, see :ref:`algorithms`. - Optional input. Pointer to the :math:`n \times 1` numeric table with weights of observations. .. note:: - + The input can be an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``. - + By default all weights are equal to :math:`1`. .. note:: @@ -107,15 +109,18 @@ The DBSCAN algorithms calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the result of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for DBSCAN (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``assignments`` - Pointer to the :math:`n \times 1` numeric table with assignments of cluster indices to observations in the input data. - + :term:`Noise observations ` have the assignment equal to :math:`-1`. * - ``nClusters`` diff --git a/docs/source/daal/algorithms/dbscan/computation-distributed.rst b/docs/source/daal/algorithms/dbscan/computation-distributed.rst index 6638c47f371..ae2936fa715 100644 --- a/docs/source/daal/algorithms/dbscan/computation-distributed.rst +++ b/docs/source/daal/algorithms/dbscan/computation-distributed.rst @@ -19,22 +19,8 @@ Distributed Processing This mode assumes that the data set is split into ``nBlocks`` blocks across computation nodes. -To compute DBSCAN algorithm in the distributed processing mode, -use the general schema described in :ref:`algorithms` as follows: - -- `Step 1 - on Local Nodes`_ -- `Step 2 - on Local Nodes`_ -- `Step 3 - on Local Nodes`_ -- `Step 4 - on Local Nodes`_ -- `Step 5 - on Local Nodes`_ -- `Step 6 - on Local Nodes`_ -- `Step 7 - on Master Node`_ -- `Step 8 - on Local Nodes`_ -- `Step 9 - on Master Node`_ -- `Step 10 - on Local Nodes`_ -- `Step 11 - on Local Nodes`_ -- `Step 12 - on Local Nodes`_ -- `Step 13 - on Local Nodes`_ +To compute DBSCAN algorithm in the distributed processing mode, +use the general schema described in :ref:`algorithms` with the following steps: .. _dbscan_step_1: diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters.rst index ad162cc9e13..2f20bc34d40 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters.rst @@ -14,9 +14,12 @@ .. * limitations under the License. .. *******************************************************************************/ -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Distributed Processing, Step 5) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks.rst index 13ce833cb0c..727c9a012c0 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks.rst @@ -14,9 +14,12 @@ .. * limitations under the License. .. *******************************************************************************/ -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks_left_right.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks_left_right.rst index aa38e3449cd..f54e84be6dd 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks_left_right.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/includes/parameters_blocks_left_right.rst @@ -14,9 +14,12 @@ .. * limitations under the License. .. *******************************************************************************/ -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-1.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-1.rst index d60e84250ae..f2d7c94ffc5 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-1.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-1.rst @@ -18,10 +18,12 @@ In this step, the DBSCAN algorithm has the following parameters: .. include:: distributed-steps/includes/parameters_blocks.rst -In this step, the DBSCAN algorithm accepts the input described below. +In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -29,7 +31,7 @@ Pass the ``Input ID`` as a parameter to the methods that provide input for your - Input * - ``step1Data`` - Pointer to the :math:`n \times p` numeric table with the observations to be clustered. - + .. note:: The input can be an object of any class derived from NumericTable. Algorithm Output @@ -39,15 +41,17 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 * - Partial Result ID - Result * - ``partialOrder`` - - Pointer to the :math:`n \times 2` numeric table containing information about observations: - identifier of initial block and index in initial block. + - Pointer to the :math:`n \times 2` numeric table containing information about observations: + identifier of initial block and index in initial block. This information will be required to reconstruct initial blocks after transferring observations among nodes. .. include:: ./../../includes/default_result_numeric_table.rst diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-10.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-10.rst index a9733fefdbd..0d0dde27ea4 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-10.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-10.rst @@ -22,9 +22,12 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 10) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -46,9 +49,12 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 10) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result @@ -60,7 +66,7 @@ For more details, :ref:`algorithms`. * - ``step10FinishedFlag`` - Pointer to :math:`1 \times 1` numeric table containing the flag indicating that the clusters numeration process is finished for current node. - .. include:: ./../../includes/default_result_numeric_table.rst + .. include:: ./../../includes/default_result_numeric_table.rst * - ``step10Queries`` - Pointer to the collection of ``nBlocks`` numeric tables with :math:`4` columns and arbitrary number of rows containing clusters numeration queries that should be processed on each node. diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-11.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-11.rst index 26cc4a84705..041d00cb089 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-11.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-11.rst @@ -22,9 +22,12 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 11) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -47,9 +50,12 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 11) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result @@ -66,7 +72,7 @@ For more details, :ref:`algorithms`. * - ``step11Queries`` - Pointer to the collection of ``nBlocks`` numeric tables with :math:`4` columns and arbitrary number of rows containing clusters numeration queries that should be processed on each node. - + Numeric tables in the collection are ordered by the identifiers of initial block of nodes. .. include:: ./../../includes/default_result_data_collection.rst diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-12.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-12.rst index e3d13173146..129d5636064 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-12.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-12.rst @@ -22,9 +22,12 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 12) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -48,7 +51,9 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 12) :widths: 10 60 :header-rows: 1 @@ -58,6 +63,6 @@ For more details, :ref:`algorithms`. - Pointer to the collection of ``nBlocks`` numeric tables with :math:`2` columns and arbitrary number of rows containing clusters assigning queries that should be processed on each node. - Numeric tables in the collection are ordered by the identifiers of initial block of nodes. + Numeric tables in the collection are ordered by the identifiers of initial block of nodes. .. include:: ./../../includes/default_result_data_collection.rst diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-13.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-13.rst index 4b36e7e719a..ff67183cdaa 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-13.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-13.rst @@ -22,7 +22,9 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 13) :widths: 10 60 :header-rows: 1 @@ -41,7 +43,9 @@ In this step, the DBSCAN algorithms calculates the results and partial results d Pass the ``Result ID`` as a parameter to the methods that access the result and partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for DBSCAN (Distributed Processing, Step 13) :widths: 10 60 :header-rows: 1 @@ -54,7 +58,9 @@ For more details, :ref:`algorithms`. .. include:: ./../../includes/default_result_numeric_table.rst -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 13) :widths: 10 60 :header-rows: 1 diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-2.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-2.rst index 98476c13de5..14d16c232a3 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-2.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-2.rst @@ -22,7 +22,9 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -40,7 +42,9 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-3.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-3.rst index 99764805f48..46270340eba 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-3.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-3.rst @@ -22,23 +22,26 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``partialData`` - Pointer to the collection of numeric tables with :math:`p` columns and arbitrary number of rows, containing observations to be clustered. - + .. include:: ./../../includes/input_data_collection.rst * - ``step3PartialBoundingBoxes`` - Pointer to the collection of the :math:`2 \times p` numeric tables containing bounding boxes computed on :ref:`step 2 ` and collected from all nodes participating in current iteration of geometric repartitioning process. - - .. note:: - + + .. note:: + The numeric tables in collection can be an object of any class derived from ``NumericTable`` except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -49,7 +52,9 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 @@ -57,5 +62,5 @@ For more details, :ref:`algorithms`. - Result * - ``split`` - Pointer to the :math:`1 \times 2` numeric table containing information about split for current iteration of geometric repartitioning. - + .. include:: ./../../includes/default_result_numeric_table.rst diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-4.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-4.rst index 3a78dc47b35..6d52770ff9c 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-4.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-4.rst @@ -19,12 +19,15 @@ In this step, the DBSCAN algorithm has the following parameters: .. include:: distributed-steps/includes/parameters_blocks_left_right.rst In this step, the DBSCAN algorithm accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 4) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -53,7 +56,9 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 4) :widths: 10 60 :header-rows: 1 @@ -62,8 +67,8 @@ For more details, :ref:`algorithms`. * - ``partitionedData`` - Pointer to the collection of (``leftBlocks`` + ``rightBlocks``) numeric tables with :math:`p` columns and arbitrary number of rows containing observations for processing on nodes participating in current iteration of geometric repartitioning. - + - First ``leftBlocks`` numeric tables in collection have the value of selected split feature smaller than selected split value. - Next ``rightBlocks`` numeric tables in collection have the value of selected split feature larger than selected split value. - + .. include:: ./../../includes/default_result_numeric_table.rst diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-5.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-5.rst index 62cb2c59428..6b1847e0f7a 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-5.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-5.rst @@ -16,9 +16,12 @@ In this step, the DBSCAN algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Distributed Processing, Step 5) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -43,12 +46,15 @@ In this step, the DBSCAN algorithm has the following parameters: - The maximum distance between observations lying in the same neighborhood. In this step, the DBSCAN algorithm accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 5) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -70,9 +76,12 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 5) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-6.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-6.rst index ca22d7b3ee6..797590e19e2 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-6.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-6.rst @@ -16,9 +16,12 @@ In this step, the DBSCAN algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for DBSCAN (Distributed Processing, Step 6) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -47,7 +50,7 @@ In this step, the DBSCAN algorithm has the following parameters: * - ``memorySavingMode`` - ``false`` - If flag is set to false, all neighborhoods will be computed and stored prior to clustering. - It will require up to :math:`O(|\text{sum of sizes of neighborhoods}|)` of additional memory, + It will require up to :math:`O(|\text{sum of sizes of neighborhoods}|)` of additional memory, which in worst case can be :math:`O(|\text{number of observations}|^2)`. However, in general, performance may be better. @@ -55,9 +58,12 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 6) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -74,16 +80,16 @@ For more details, :ref:`algorithms`. * - ``haloDataIndices`` - Pointer to the collection of numeric tables with :math:`1` column and arbitrary number of rows, - containing indices for halo observations for current node computed on :ref:`step 5 `. - + containing indices for halo observations for current node computed on :ref:`step 5 `. + Size of this collection should be equal to the size of collection for ``haloData``'s ``Input ID``. .. include:: ./../../includes/input_data_collection_with_exceptions.rst * - ``haloDataBlocks`` - Pointer to the collection of :math:`1 \times 1` numeric tables containing identifiers of initial block for halo observations - for current node computed on :ref:`step 5 `. - + for current node computed on :ref:`step 5 `. + Size of this collection should be equal to the size of collection for ``haloData``'s ``Input ID``. .. include:: ./../../includes/input_data_collection_with_exceptions.rst @@ -95,9 +101,12 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 6) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-7.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-7.rst index f0189b18f57..fcb787ffc8f 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-7.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-7.rst @@ -22,7 +22,9 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 7) :widths: 10 60 :header-rows: 1 @@ -31,7 +33,7 @@ For more details, :ref:`algorithms`. * - ``partialFinishedFlags`` - Pointer to the collection of :math:`1 \times 1` numeric table containing the flag indicating that the clustering process is finished collected from all nodes. - + .. include:: ./../../includes/input_data_collection_with_exceptions.rst Algorithm Output @@ -41,7 +43,9 @@ In this step, the DBSCAN algorithms calculates the results and partial results d Pass the ``Result ID`` as a parameter to the methods that access the result and partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 7) :widths: 10 60 :header-rows: 1 diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-8.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-8.rst index 671385a0f37..327b3b438ed 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-8.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-8.rst @@ -22,9 +22,12 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 8) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -52,9 +55,12 @@ In this step, the DBSCAN algorithms calculates the partial results described bel Pass the ``Partial Result ID`` as a parameter to the methods that access the partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 8) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result @@ -62,7 +68,7 @@ For more details, :ref:`algorithms`. - Pointer to the numeric table with :math:`4` columns and arbitrary number of rows containing information about current clustering state of observations processed on the local node. - .. include:: ./../../includes/default_result_numeric_table.rst + .. include:: ./../../includes/default_result_numeric_table.rst * - ``step8FinishedFlag`` - Pointer to :math:`1 \times 1` numeric table containing the flag indicating that the clustering process is finished for current node. diff --git a/docs/source/daal/algorithms/dbscan/distributed-steps/step-9.rst b/docs/source/daal/algorithms/dbscan/distributed-steps/step-9.rst index 3dccfe1a9a5..82c64208935 100644 --- a/docs/source/daal/algorithms/dbscan/distributed-steps/step-9.rst +++ b/docs/source/daal/algorithms/dbscan/distributed-steps/step-9.rst @@ -22,7 +22,9 @@ In this step, the DBSCAN algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for DBSCAN (Distributed Processing, Step 9) :widths: 10 60 :header-rows: 1 @@ -40,7 +42,9 @@ In this step, the DBSCAN algorithms calculates the results and partial results d Pass the ``Result ID`` as a parameter to the methods that access the result and partial result of your algorithm. For more details, :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for DBSCAN (Distributed Processing, Step 9) :widths: 10 60 :header-rows: 1 @@ -51,7 +55,9 @@ For more details, :ref:`algorithms`. .. include:: ./../../includes/default_result_numeric_table.rst -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for DBSCAN (Distributed Processing, Step 9) :widths: 10 60 :header-rows: 1 diff --git a/docs/source/daal/algorithms/dbscan/index.rst b/docs/source/daal/algorithms/dbscan/index.rst index a6dfe30ce59..bf1c6d4e146 100644 --- a/docs/source/daal/algorithms/dbscan/index.rst +++ b/docs/source/daal/algorithms/dbscan/index.rst @@ -23,7 +23,7 @@ Density-Based Spatial Clustering of Applications with Noise =========================================================== -Density-based spatial clustering of applications with noise (DBSCAN) is a data clustering algorithm proposed in [Ester96]_. +Density-based spatial clustering of applications with noise (DBSCAN) is a data clustering algorithm proposed in [Ester96]_. It is a density-based clustering non-parametric algorithm: given a set of observations in some space, it groups together observations that are closely packed together (observations with many nearby neighbors), marking as outliers observations that lie alone in low-density regions (whose nearest neighbors are too far away). @@ -31,7 +31,7 @@ marking as outliers observations that lie alone in low-density regions (whose ne Details ******* -Given the set :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})\}` +Given the set :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})\}` of :math:`n` :math:`p`-dimensional feature vectors (further referred as observations), a positive floating-point number ``epsilon`` and a positive integer ``minObservations``, the problem is to get clustering assignments for each input observation, based on the definitions below [Ester96]_: @@ -43,11 +43,11 @@ the problem is to get clustering assignments for each input observation, based o input observations (including |x|) are within distance ``epsilon`` from observation |x|; directly reachable - An observation |y| is directly reachable from |x| if |y| is within distance ``epsilon`` from :term:`core observation` |x|. + An observation |y| is directly reachable from |x| if |y| is within distance ``epsilon`` from :term:`core observation` |x|. Observations are only said to be directly reachable from :term:`core observations `. reachable - An observation |y| is reachable from an observation |x| if there is a path :math:`x_1, \ldots, x_m` + An observation |y| is reachable from an observation |x| if there is a path :math:`x_1, \ldots, x_m` with :math:`x_1 = x` and :math:`x_m = y`, where each :math:`x_{i+1}` is :term:`directly reachable` from :math:`x_i`. This implies that all observations on the path must be :term:`core observations `, with the possible exception of |y|. @@ -55,11 +55,11 @@ the problem is to get clustering assignments for each input observation, based o Noise observations are observations that are :term:`not reachable ` from any other observation. cluster - Two observations |x| and |y| are considered to be in the same cluster if there is a :term:`core observation` :math:`z`, + Two observations |x| and |y| are considered to be in the same cluster if there is a :term:`core observation` :math:`z`, and |x| and |y| are both :term:`reachable` from :math:`z`. Each cluster gets a unique identifier, an integer number from :math:`0` to :math:`\text{total number of clusters } – 1`. -Each observation is assigned an identifier of the :term:`cluster` it belongs to, +Each observation is assigned an identifier of the :term:`cluster` it belongs to, or :math:`-1` if the observation considered to be a :term:`noise observation`. Computation @@ -69,7 +69,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-distributed.rst @@ -109,9 +109,9 @@ Examples .. tab:: Python* Batch Processing: - + - :daal4py_example:`dbscan_batch.py` Distributed Processing: - + - :daal4py_example:`dbscan_spmd.py` diff --git a/docs/source/daal/algorithms/decision_forest/decision-forest-classification.rst b/docs/source/daal/algorithms/decision_forest/decision-forest-classification.rst index b58bffeec72..0bcff24c483 100644 --- a/docs/source/daal/algorithms/decision_forest/decision-forest-classification.rst +++ b/docs/source/daal/algorithms/decision_forest/decision-forest-classification.rst @@ -30,7 +30,7 @@ Details Given: -- :math:`n` feature vectors :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np}) \}` +- :math:`n` feature vectors :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np}) \}` of size :math:`p`; - their non-negative sample weights :math:`w = (w_1, \ldots, w_n)`; - the vector of class labels :math:`y = (y_1, \ldots, y_n)` that describes the class @@ -52,12 +52,14 @@ Gini index is an impurity metric, calculated as follows: .. math:: {I}_{Gini}\left(D\right)=1-\sum _{i=0}^{C-1}{p}_{i}^{2} -where +where - :math:`D` is a set of observations that reach the node; - :math:`p_i` is specified in the table below: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Decision Forest Classification: impurity calculations :widths: 10 10 :header-rows: 1 :align: left @@ -74,9 +76,9 @@ where Prediction Stage **************** -Given decision forest classifier and vectors :math:`x_1, \ldots, x_r`, +Given decision forest classifier and vectors :math:`x_1, \ldots, x_r`, the problem is to calculate the labels for those -vectors. To solve the problem for each given query vector :math:`x_i`, +vectors. To solve the problem for each given query vector :math:`x_i`, the algorithm finds the leaf node in a tree in the forest that gives the classification response by that tree. The forest chooses the label y taking the majority of trees in the @@ -134,8 +136,8 @@ complete the following steps: Each tree consists of internal nodes (called non-leaf or split nodes) and external nodes (leaf nodes). Each split node denotes a feature test that is a Boolean expression, for example, - f < ``featureValue`` or f = ``featureValue``, where f is a feature and ``featureValue`` is a constant. - The test type depends on the feature type: continuous, categorical, or ordinal. + f < ``featureValue`` or f = ``featureValue``, where f is a feature and ``featureValue`` is a constant. + The test type depends on the feature type: continuous, categorical, or ordinal. For more information on the test types, see :ref:`decision_tree`. The inducted decision tree is a binary tree, meaning that each non-leaf node has exactly two branches: true and false. @@ -157,7 +159,7 @@ Examples - :cpp_example:`df_cls_traversed_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`DfClsDenseBatchModelBuilder.java ` @@ -180,11 +182,13 @@ In addition to the parameters of a classifier (see :ref:`classification_usage_mo described in :ref:`df_batch`, the training algorithm for decision forest classification has the following parameters: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| -.. list-table:: +.. list-table:: Training Parameters for Decision Forest Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -195,7 +199,7 @@ following parameters: * - ``method`` - ``defaultDense`` - The computation method used by the decision forest classification. - + For CPU: - ``defaultDense`` - default performance-oriented method @@ -223,10 +227,13 @@ For the description of the input and output, refer to :ref:`classification_usage In addition to the parameters of a classifier, decision forest classification has the following parameters at the prediction stage: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Decision Forest Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -281,11 +288,11 @@ Examples - :cpp_example:`df_cls_traverse_model.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`DfClsDefaultDenseBatch.java ` - :java_example:`DfClsHistDenseBatch.java ` - :java_example:`DfClsTraverseModel.java ` diff --git a/docs/source/daal/algorithms/decision_forest/decision-forest-regression.rst b/docs/source/daal/algorithms/decision_forest/decision-forest-regression.rst index 38ba2093615..a01e6622fb3 100644 --- a/docs/source/daal/algorithms/decision_forest/decision-forest-regression.rst +++ b/docs/source/daal/algorithms/decision_forest/decision-forest-regression.rst @@ -30,7 +30,7 @@ Details Given: -- :math:`n` feature vectors :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np}) \}` +- :math:`n` feature vectors :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np}) \}` of size :math:`p`; - their non-negative sample weights :math:`w = (w_1, \ldots, w_n)`; - the vector of responses :math:`y = (y_1, \ldots, y_n)` @@ -46,10 +46,13 @@ If sample weights are provided as input, the library uses a weighted version of MSE is an impurity metric (:math:`D` is a set of observations that reach the node), calculated as follows: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Decision Forest Regression: impurity calculations :widths: 10 10 :header-rows: 1 :align: left + :class: longtable * - Without sample weights - With sample weights @@ -105,13 +108,16 @@ Training For the description of the input and output, refer to :ref:`regression_usage_model`. -In addition to the decision forest parameters described in :ref:`df_batch`, +In addition to the decision forest parameters described in :ref:`df_batch`, the training algorithm for decision forest regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Decision Forest Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -131,7 +137,7 @@ the training algorithm for decision forest regression has the following paramete For GPU: - ``hist`` - :ref:`inexact histogram computation method ` - + Output ****** @@ -148,10 +154,13 @@ For the description of the input and output, refer to :ref:`regression_usage_mod In addition to the parameters of regression, decision forest regression has the following parameters at the prediction stage: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Decision Forest Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -190,7 +199,7 @@ Examples - :cpp_example:`df_reg_traverse_model.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/decision_forest/decision-forest.rst b/docs/source/daal/algorithms/decision_forest/decision-forest.rst index dfd1870fe02..bc84cad5821 100644 --- a/docs/source/daal/algorithms/decision_forest/decision-forest.rst +++ b/docs/source/daal/algorithms/decision_forest/decision-forest.rst @@ -16,7 +16,7 @@ .. _decision_forest: -Decision Forest +Decision Forest ================ Details @@ -101,7 +101,7 @@ Maximal number of leaf nodes Grow trees with positive maximal number of leaf nodes in a :ref:`best-first ` fashion. Best nodes are defined by relative reduction in impurity. If maximal number of leaf nodes equals zero, then this criterion does not limit the number of leaf nodes, - and trees grow in a :ref:`depth-first ` fashion. + and trees grow in a :ref:`depth-first ` fashion. Tree Building Strategies ++++++++++++++++++++++++ @@ -115,7 +115,7 @@ Depth-first Strategy ~~~~~~~~~~~~~~~~~~~~ If maximal number of leaf nodes equals zero, a decision tree is built using depth-first strategy. -In each terminal node :math:`t`, the following recursive procedure is applied: +In each terminal node :math:`t`, the following recursive procedure is applied: - Stop if the termination criteria are met. - Choose randomly without replacement :math:`m` feature indices :math:`J_t \in \{0, 1, \ldots, p-1\}`. @@ -219,38 +219,38 @@ Variable Importance There are two main types of variable importance measures: -- *Mean Decrease Impurity* importance (MDI). +- *Mean Decrease Impurity* importance (MDI). - Importance of the :math:`j`-th variable for predicting :math:`Y` is the sum of - weighted impurity decreases :math:`p(t) \Delta i(s_t, t)` for all nodes - :math:`t` that use :math:`x_j`, averaged over all :math:`B` trees in the - forest: + Importance of the :math:`j`-th variable for predicting :math:`Y` is the sum of + weighted impurity decreases :math:`p(t) \Delta i(s_t, t)` for all nodes + :math:`t` that use :math:`x_j`, averaged over all :math:`B` trees in the + forest: - .. math:: - MDI\left(j\right)=\frac{1}{B}\sum _{b=1}^{B} \sum _{t\in {T}_{b}:v\left({s}_{t}\right)=j}p\left(t\right)\Delta i\left({s}_{t},t\right), + .. math:: + MDI\left(j\right)=\frac{1}{B}\sum _{b=1}^{B} \sum _{t\in {T}_{b}:v\left({s}_{t}\right)=j}p\left(t\right)\Delta i\left({s}_{t},t\right), - where :math:`p\left(t\right)=\frac{|{D}_{t}|}{|D|}` is the fraction of observations reaching node :math:`t` - in the tree :math:`T_b`, and :math:`v(s_t)` is the index of the - variable used in split :math:`s_t` . + where :math:`p\left(t\right)=\frac{|{D}_{t}|}{|D|}` is the fraction of observations reaching node :math:`t` + in the tree :math:`T_b`, and :math:`v(s_t)` is the index of the + variable used in split :math:`s_t` . -- *Mean Decrease Accuracy* (MDA). +- *Mean Decrease Accuracy* (MDA). - Importance of the :math:`j`-th variable for predicting :math:`Y` is the average - increase in the OOB error over all trees in the forest when the - values of the :math:`j`-th variable are randomly permuted in the OOB - set. For that reason, this latter measure is also known as - *permutation importance*. + Importance of the :math:`j`-th variable for predicting :math:`Y` is the average + increase in the OOB error over all trees in the forest when the + values of the :math:`j`-th variable are randomly permuted in the OOB + set. For that reason, this latter measure is also known as + *permutation importance*. - In more details, the library calculates MDA importance as - follows: + In more details, the library calculates MDA importance as + follows: - - Let :math:`\pi (X,j)` be the set of feature vectors where the :math:`j`-th variable is randomly permuted over all vectors in the set. - - Let :math:`E_b` be the OOB error calculated for :math:`T_b:` on its out-of-bag dataset :math:`\overline{D_b}`. - - Let :math:`E_{b,j}` be the OOB error calculated for :math:`T_b:` using :math:`\pi \left(\overline{{X}_{b}},j\right)`, and its out-of-bag dataset :math:`\overline{D_b}` is permuted on the :math:`j`-th variable. Then + - Let :math:`\pi (X,j)` be the set of feature vectors where the :math:`j`-th variable is randomly permuted over all vectors in the set. + - Let :math:`E_b` be the OOB error calculated for :math:`T_b:` on its out-of-bag dataset :math:`\overline{D_b}`. + - Let :math:`E_{b,j}` be the OOB error calculated for :math:`T_b:` using :math:`\pi \left(\overline{{X}_{b}},j\right)`, and its out-of-bag dataset :math:`\overline{D_b}` is permuted on the :math:`j`-th variable. Then - * :math:`{\delta }_{b,j}={E}_{b}-{E}_{b,j}` is the OOB error increase for the tree :math:`T_b`. - * :math:`Raw MDA\left(j\right)=\frac{1}{B}\sum _{b=1}^{B}{\delta }_{b,j}` is MDA importance. - * :math:`Scaled MDA\left(j\right)=\frac{Raw MDA\left({x}_{j}\right)}{\frac{{\sigma }_{j}}{\sqrt{B}}}`, where :math:`{\sigma }_{j}^{2}` is the variance of :math:`D_{b,j}` + * :math:`{\delta }_{b,j}={E}_{b}-{E}_{b,j}` is the OOB error increase for the tree :math:`T_b`. + * :math:`Raw MDA\left(j\right)=\frac{1}{B}\sum _{b=1}^{B}{\delta }_{b,j}` is MDA importance. + * :math:`Scaled MDA\left(j\right)=\frac{Raw MDA\left({x}_{j}\right)}{\frac{{\sigma }_{j}}{\sqrt{B}}}`, where :math:`{\sigma }_{j}^{2}` is the variance of :math:`D_{b,j}` .. _df_batch: @@ -265,10 +265,13 @@ Training At the training stage, decision forest regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Decision Forest (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -328,12 +331,12 @@ At the training stage, decision forest regression has the following parameters: request a single characteristic or use bitwise OR to request a combination of the characteristics: - + ``computeOutOfBagError`` - + ``computeOutOfBagErrorPerObservation`` + + ``computeOutOfBagError`` + + ``computeOutOfBagErrorPerObservation`` * - ``bootstrap`` - ``true`` - If true, the training set for a tree is a bootstrap of the whole training set. - If false, the whole training set is used to build trees. + If false, the whole training set is used to build trees. * - ``minObservationsInLeafNode`` - :math:`1` for classification, :math:`5` for regression - Minimum number of observations in the leaf node. @@ -344,7 +347,7 @@ At the training stage, decision forest regression has the following parameters: - :math:`0.0` - Minimum weighted fraction of the sum total of weights of all the input observations required to be at a leaf node, from :math:`0.0` to :math:`0.5`. - + All observations have equal weights if the weights of the observations are not provided. * - ``minImpurityDecreaseInSplitNode`` @@ -366,28 +369,31 @@ In addition to regression or classifier output, decision forest calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the result of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Decision Forest (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result * - ``outOfBagError`` - A numeric table :math:`1 \times 1` containing out-of-bag error computed when the ``computeOutOfBagErroroption`` option is on. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable``. * - ``variableImportance`` - A numeric table :math:`1 \times p` that contains variable importance values for each feature. If you set the ``varImportance`` parameter to none, the library returns a null pointer to the table. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. @@ -397,9 +403,9 @@ parameter to the methods that access the result of your algorithm. :math:`-1` in the table indicates that no OOB value was computed because this observation was not in OOB set for any of the trees in the model (never left out during the bootstrap). - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable``. * - ``updatedEngine`` diff --git a/docs/source/daal/algorithms/decision_forest/index.rst b/docs/source/daal/algorithms/decision_forest/index.rst index d0b75f53e89..4048f4dacd0 100644 --- a/docs/source/daal/algorithms/decision_forest/index.rst +++ b/docs/source/daal/algorithms/decision_forest/index.rst @@ -37,7 +37,7 @@ from the tree. For more details, see [Breiman84]_ and [Breiman2001]_. .. toctree:: :maxdepth: 1 - + decision-forest.rst decision-forest-regression decision-forest-classification diff --git a/docs/source/daal/algorithms/decision_tree/decision-tree-classification.rst b/docs/source/daal/algorithms/decision_tree/decision-tree-classification.rst index 5fdc3c420ec..957c38b205a 100644 --- a/docs/source/daal/algorithms/decision_tree/decision-tree-classification.rst +++ b/docs/source/daal/algorithms/decision_tree/decision-tree-classification.rst @@ -74,16 +74,16 @@ based on split criteria Gini index [Breiman84]_ and Information gain [Quinlan86] #. Information gain - .. math:: - \text{Δ}{I}_{Gini}\left(D, \text{τ}\right)={I}_{Gini}\left(D\right)-\frac{|{D}_{true}|}{|D|}{I}_{Gini}\left({D}_{true}\right)-\frac{|{D}_{false}|}{|D|}{I}_{Gini}\left({D}_{false}\right) + .. math:: + \text{Δ}{I}_{Gini}\left(D, \text{τ}\right)={I}_{Gini}\left(D\right)-\frac{|{D}_{true}|}{|D|}{I}_{Gini}\left({D}_{true}\right)-\frac{|{D}_{false}|}{|D|}{I}_{Gini}\left({D}_{false}\right) - where + where - - :math:`O(\tau)`, :math:`D`, :math:`D_v` are defined above - - :math:`{I}_{Entropy}\left(D\right)=-\sum _{i=0}^{C-1}{p}_{i}\mathrm{log}{p}_{i}`, with :math:`p_i` defined above in Gini index. + - :math:`O(\tau)`, :math:`D`, :math:`D_v` are defined above + - :math:`{I}_{Entropy}\left(D\right)=-\sum _{i=0}^{C-1}{p}_{i}\mathrm{log}{p}_{i}`, with :math:`p_i` defined above in Gini index. - Similarly to Gini index, the test to be used in the node is selected as :math:`\underset{\tau }{\text{argmax}}InfoGain\left(D,\tau \right)`. For binary decision tree with 'true' and 'false' branches, :math:`\text{Δ}{I}_{Gini}\left(D, \text{τ}\right)={I}_{Gini}\left(D\right)-\frac{|{D}_{true}|}{|D|}{I}_{Gini}\left({D}_{true}\right)-\frac{|{D}_{false}|}{|D|}{I}_{Gini}\left({D}_{false}\right)` + Similarly to Gini index, the test to be used in the node is selected as :math:`\underset{\tau }{\text{argmax}}InfoGain\left(D,\tau \right)`. For binary decision tree with 'true' and 'false' branches, :math:`\text{Δ}{I}_{Gini}\left(D, \text{τ}\right)={I}_{Gini}\left(D\right)-\frac{|{D}_{true}|}{|D|}{I}_{Gini}\left({D}_{true}\right)-\frac{|{D}_{false}|}{|D|}{I}_{Gini}\left({D}_{false}\right)` Training Stage -------------- @@ -112,10 +112,13 @@ Training In addition to common input for a classifier, decision trees can accept the following inputs that are used for post-pruning: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Decision Tree Classification (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 + :class: longtable * - Input ID - Input @@ -130,10 +133,13 @@ inputs that are used for post-pruning: At the training stage, decision tree classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Decision Tree Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -176,10 +182,13 @@ Prediction At the prediction stage, decision tree classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Decision Tree Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -205,7 +214,7 @@ Examples - :cpp_example:`dt_cls_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/decision_tree/decision-tree-regression.rst b/docs/source/daal/algorithms/decision_tree/decision-tree-regression.rst index a96aaa62819..e37a3c685d7 100644 --- a/docs/source/daal/algorithms/decision_tree/decision-tree-regression.rst +++ b/docs/source/daal/algorithms/decision_tree/decision-tree-regression.rst @@ -70,7 +70,7 @@ Prediction Stage The regression decision tree follows the algorithmic framework of decision tree prediction described in :ref:`decision_tree`. -Given the regression decision tree and vectors :math:`x_1, \ldots, x_r`, +Given the regression decision tree and vectors :math:`x_1, \ldots, x_r`, the problem is to calculate the responses for those vectors. Batch Processing @@ -85,10 +85,13 @@ Training At the training stage, decision tree regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Decision Forest Regression (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -130,10 +133,13 @@ Prediction At the prediction stage, decision tree regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Decision Forest Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -158,7 +164,7 @@ Examples - :cpp_example:`dt_reg_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/decision_tree/decision-tree.rst b/docs/source/daal/algorithms/decision_tree/decision-tree.rst index ef971b88c35..61efdd8a701 100644 --- a/docs/source/daal/algorithms/decision_tree/decision-tree.rst +++ b/docs/source/daal/algorithms/decision_tree/decision-tree.rst @@ -37,8 +37,11 @@ the figure below, where: test - Each external node (leaf) denotes the mentioned simple model -.. image:: images/decision-tree-structure.png +.. figure:: images/decision-tree-structure.png :width: 600 + :alt: + + Decision Tree Structure The test is a rule for partitioning of the feature space. The test depends on feature values. Each outcome of the test represents an diff --git a/docs/source/daal/algorithms/distance/correlation.rst b/docs/source/daal/algorithms/distance/correlation.rst index b57c492ce5e..364dfc75b68 100644 --- a/docs/source/daal/algorithms/distance/correlation.rst +++ b/docs/source/daal/algorithms/distance/correlation.rst @@ -18,7 +18,7 @@ Correlation Distance Matrix =========================== Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots x_n = (x_{n1}, \ldots, x_{np})` -of dimension Lmath:`p`, +of dimension :math:`p`, the problem is to compute the symmetric :math:`n \times n` matrix :math:`D_{\text{cor}} = (d_{ij})` of distances between feature vectors, where @@ -26,7 +26,7 @@ of distances between feature vectors, where d_{ij} = 1 - \frac {\sum_{k=1}^{p} (x_{ik} - \overline{x_i}) (x_{jk} - \overline{x_j})} - {\sqrt{ \sum_{k=1}^{p} (x_{ik} - \overline{x_i})^2 } + {\sqrt{ \sum_{k=1}^{p} (x_{ik} - \overline{x_i})^2 } \sqrt{ \sum_{k=1}^{p} (x_{jk} - \overline{x_j})^2 }} .. math:: @@ -48,11 +48,13 @@ Batch Processing Algorithm Input --------------- -The correlation distance matrix algorithm accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +The correlation distance matrix algorithm accepts the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Correlation Distance Matrix (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -60,7 +62,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n \times p` numeric table for which the distance is computed. - + The input can be an object of any class derived from ``NumericTable``. Algorithm Parameters @@ -68,10 +70,13 @@ Algorithm Parameters The correlation distance matrix algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Correlation Distance Matrix (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -86,19 +91,21 @@ The correlation distance matrix algorithm has the following parameters: Algorithm Output ---------------- -The correlation distance matrix algorithm calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The correlation distance matrix algorithm calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Correlation Distance Matrix (Batch Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``correlationDistance`` - - Pointer to the numeric table that represents the :math:`n \times n` symmetric distance matrix :math:`D_\text{cor}`. - + - Pointer to the numeric table that represents the :math:`n \times n` symmetric distance matrix :math:`D_\text{cor}`. + By default, the result is an object of the ``PackedSymmetricMatrix`` class with the ``lowerPackedSymmetricMatrix`` layout. However, you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. @@ -112,9 +119,9 @@ Examples Batch Processing: - :cpp_example:`cor_dist_dense_batch.cpp ` - + .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -124,7 +131,7 @@ Examples .. tab:: Python* Batch Processing: - + - :daal4py_example:`correlation_distance_batch.py` Performance Considerations diff --git a/docs/source/daal/algorithms/distance/cosine.rst b/docs/source/daal/algorithms/distance/cosine.rst index 9cda1fa7fbc..d2e07820336 100644 --- a/docs/source/daal/algorithms/distance/cosine.rst +++ b/docs/source/daal/algorithms/distance/cosine.rst @@ -18,7 +18,7 @@ Cosine Distance Matrix ====================== Given :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots x_n = (x_{n1}, \ldots, x_{np})` -of dimension Lmath:`p`, +of dimension Lmath:`p`, the problem is to compute the symmetric :math:`n \times n` matrix :math:`D_{\text{cos}} = (d_{ij})` of distances between feature vectors, where @@ -26,7 +26,7 @@ of distances between feature vectors, where d_{ij} = 1 - \frac {\sum_{k=1}^{p} x_{ik} x_{jk}} - {\sqrt{ \sum_{k=1}^{p} x_{ik}^2 } + {\sqrt{ \sum_{k=1}^{p} x_{ik}^2 } \sqrt{ \sum_{k=1}^{p} x_{jk}^2 }} .. math:: @@ -42,11 +42,13 @@ Batch Processing Algorithm Input --------------- -The cosine distance matrix algorithm accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +The cosine distance matrix algorithm accepts the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Cosine Distance Matrix (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -54,7 +56,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n \times p` numeric table for which the distance is computed. - + The input can be an object of any class derived from ``NumericTable``. Algorithm Parameters @@ -62,10 +64,13 @@ Algorithm Parameters The cosine distance matrix algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Cosine Distance Matrix (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -80,19 +85,21 @@ The cosine distance matrix algorithm has the following parameters: Algorithm Output ---------------- -The cosine distance matrix algorithm calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The cosine distance matrix algorithm calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Cosine Distance Matrix (Batch Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``cosineDistance`` - - Pointer to the numeric table that represents the :math:`n \times n` symmetric distance matrix :math:`D_\text{cos}`. - + - Pointer to the numeric table that represents the :math:`n \times n` symmetric distance matrix :math:`D_\text{cos}`. + By default, the result is an object of the ``PackedSymmetricMatrix`` class with the ``lowerPackedSymmetricMatrix`` layout. However, you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. @@ -108,17 +115,17 @@ Examples - :cpp_example:`cos_dist_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`CosDistDenseBatch.java ` .. tab:: Python* Batch Processing: - + - :daal4py_example:`cosine_distance_batch.py` Performance Considerations diff --git a/docs/source/daal/algorithms/distributions/bernoulli.rst b/docs/source/daal/algorithms/distributions/bernoulli.rst index f1b578b34ab..f3dc9a0da18 100644 --- a/docs/source/daal/algorithms/distributions/bernoulli.rst +++ b/docs/source/daal/algorithms/distributions/bernoulli.rst @@ -22,7 +22,7 @@ Generates Bernoulli distributed random numbers. Details ******* -Bernoulli random number generator fills the :math:`n \times p` numeric table with +Bernoulli random number generator fills the :math:`n \times p` numeric table with Bernoulli distributed values with the :math:`p` probability of success on a single trial, where :math:`p \in R`, :math:`0 \leq p \leq 1`. @@ -39,7 +39,7 @@ The probability distribution is given by: The cumulative distribution function is as follows: .. math:: - F_p(x) = + F_p(x) = \begin{cases} 0, & x < 0 \\ 1 - p, & 0 \leq x < 1, x \in \mathbb{R} \\ @@ -53,10 +53,13 @@ Batch Processing Bernoulli distribution algorithm has the following parameters in addition to the common parameters specified in :ref:`distributions`: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Bernoulli Distribution (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -69,7 +72,7 @@ Bernoulli distribution algorithm has the following parameters in addition to the - Performance-oriented computation method, the only method supported by the algorithm. * - ``p`` - Not applicable - - Success probability of a trial, required parameter. + - Success probability of a trial, required parameter. Examples ******** diff --git a/docs/source/daal/algorithms/distributions/index.rst b/docs/source/daal/algorithms/distributions/index.rst index 947e3781ab0..62ec7cd2eef 100644 --- a/docs/source/daal/algorithms/distributions/index.rst +++ b/docs/source/daal/algorithms/distributions/index.rst @@ -28,18 +28,20 @@ of memory according to the required CDF. .. toctree:: :maxdepth: 1 - + uniform.rst normal.rst bernoulli.rst .. rubric:: Algorithm Input -Distribution algorithms accept the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Distribution algorithms accept the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Distributions :widths: 10 60 :header-rows: 1 @@ -57,9 +59,11 @@ For more details, see :ref:`algorithms`. Distribution algorithms have the following common parameter: -.. list-table:: +.. tabularcolumns:: |\Y{0.10}|\Y{0.6}|\Y{0.3}| + +.. list-table:: Algorithm Parameters for Distributions :header-rows: 1 - :widths: 10 30 30 + :widths: 10 30 30 :align: left * - Parameter @@ -71,19 +75,21 @@ Distribution algorithms have the following common parameter: .. rubric:: Algorithm Output -Distribution algorithms calculate the result described below. +Distribution algorithms calculate the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Distributions :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``randomNumbers`` - - Pointer to the :math:`n \times p` numeric table with algorithm results. - + - Pointer to the :math:`n \times p` numeric table with algorithm results. + In |short_name|, distribution algorithms are in-place, which means that the algorithm does not allocate memory for the distribution result, but returns pointer to the filled input. diff --git a/docs/source/daal/algorithms/distributions/normal.rst b/docs/source/daal/algorithms/distributions/normal.rst index d5e3b4d3099..693741053e7 100644 --- a/docs/source/daal/algorithms/distributions/normal.rst +++ b/docs/source/daal/algorithms/distributions/normal.rst @@ -39,10 +39,13 @@ Batch Processing Normal distribution algorithm has the following parameters in addition to the common parameters specified in :ref:`distributions`: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Normal Distribution (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/distributions/uniform.rst b/docs/source/daal/algorithms/distributions/uniform.rst index 0bd26fc5636..0b2508ee3ca 100644 --- a/docs/source/daal/algorithms/distributions/uniform.rst +++ b/docs/source/daal/algorithms/distributions/uniform.rst @@ -28,19 +28,19 @@ that are uniformly distributed on the interval :math:`[a, b)`, where :math:`a, b The probability density is given by: .. math:: - f_{a, b}(x) = - \begin{cases} + f_{a, b}(x) = + \begin{cases} \frac {1}{b - a}, & x \in [a, b)\\ - 0, & x \notin [a, b) + 0, & x \notin [a, b) \end{cases} The cumulative distribution function is as follows: .. math:: - F_{a, b}(x) = - \begin{cases} 0, & x < a \\ - \frac {x - a}{b - a}, & a \leq x < b \\ - 1, & x \geq b + F_{a, b}(x) = + \begin{cases} 0, & x < a \\ + \frac {x - a}{b - a}, & a \leq x < b \\ + 1, & x \geq b \end{cases} Batch Processing @@ -50,10 +50,13 @@ Batch Processing Uniform distribution algorithm has the following parameters in addition to the common parameters specified in :ref:`distributions`: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Uniform Distribution (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/em/expectation-maximization.rst b/docs/source/daal/algorithms/em/expectation-maximization.rst index 26f3b6d3ecd..94da4dd0db2 100644 --- a/docs/source/daal/algorithms/em/expectation-maximization.rst +++ b/docs/source/daal/algorithms/em/expectation-maximization.rst @@ -112,31 +112,26 @@ for :math:`i = 1, \ldots, n` and :math:`j=1, \ldots, k`. #. Maximization step: in the :math:`j`-th step, for all :math:`r=1, \ldots, k` compute: - a. - The mixture weights :math:`{\alpha }_{r}^{\left(j+1\right)}=\frac{{n}_{r}}{n}`, where :math:`{n}_{r}=\sum _{i=1}^{n}{w}_{ir}` - is the "amount" of the feature vectors that are assigned - to the :math:`r`-th mixture component + a. + The mixture weights :math:`{\alpha }_{r}^{\left(j+1\right)}=\frac{{n}_{r}}{n}`, where :math:`{n}_{r}=\sum _{i=1}^{n}{w}_{ir}` + is the "amount" of the feature vectors that are assigned + to the :math:`r`-th mixture component - b. Mean estimates :math:`{m}_{r}^{\left(j+1\right)}=\frac{1}{{n}_{r}}\sum _{i=1}^{n}{w}_{ir}{x}_{i}` + b. Mean estimates :math:`{m}_{r}^{\left(j+1\right)}=\frac{1}{{n}_{r}}\sum _{i=1}^{n}{w}_{ir}{x}_{i}` + c. + Covariance estimate :math:`\sum _{r}^{(j+1)}=({\sigma }_{r,hg}^{(j+1)})` + of size :math:`p \times p` with :math:`\sigma_{r,hg}^{(j+1)}=\frac{1}{n_r}\sum_{l=1}^{n}{w}_{lr}(x_{lh}-m_{r,h}^{(j+1)})(x_{lg}-m_{r,g}^{(j+1)})` - c. - Covariance estimate :math:`\sum _{r}^{(j+1)}=({\sigma }_{r,hg}^{(j+1)})` - of size :math:`p \times p` with :math:`\sigma_{r,hg}^{(j+1)}=\frac{1}{n_r}\sum_{l=1}^{n}{w}_{lr}(x_{lh}-m_{r,h}^{(j+1)})(x_{lg}-m_{r,g}^{(j+1)})` +#. Repeat steps 2 and 3 until any of these conditions is met: -#. - - Repeat steps 2 and 3 until any of these conditions is met: + - :math:`|\log({\theta }^{(j+1)}-{\theta }^{(j)})|<\epsilon`, where the likelihood function is: - - :math:`|\log({\theta }^{(j+1)}-{\theta }^{(j)})|<\epsilon`, where the likelihood function is: - :math:`\log(\theta)=\sum_{i=1}^{n}\log(\sum _{j=1}^{k}{pd(x}_{i}|{z}_{j},{\theta }_{j}){\alpha }_{j})` - - The number of iterations exceeds the predefined level. - Initialization ++++++++++++++ @@ -147,23 +142,15 @@ weights, vectors of means, and variance-covariance The EM initialization algorithm for GMM includes the following steps: -#. - - Perform nTrials starts of the EM algorithm with nIterations - iterations and start values: - - - Initial means - :math:`k` different random observations from the input data set - - - Initial weights - the values of :math:`1/k` - - - Initial covariance matrices - the covariance of the input data - -#. - - Regard the result of the best EM algorithm in terms of the - likelihood function values as the result of initialization +#. Perform nTrials starts of the EM algorithm with nIterations + iterations and start values: + - Initial means - :math:`k` different random observations from the input data set + - Initial weights - the values of :math:`1/k` + - Initial covariance matrices - the covariance of the input data +#. Regard the result of the best EM algorithm in terms of the + likelihood function values as the result of initialization Initialization ============== @@ -183,7 +170,9 @@ The EM for GMM initialization algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Expectation-Maximization Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -200,10 +189,13 @@ Algorithm Parameters The EM for GMM initialization algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Expectation-Maximization Initialization (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -246,10 +238,13 @@ Algorithm Output The EM for GMM initialization algorithm calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Expectation-Maximization Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result @@ -257,7 +252,7 @@ Pass the ``Result ID`` as a parameter to the methods that access the results of - Pointer to the :math:`1 \times k` numeric table with mixture weights. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -265,9 +260,9 @@ Pass the ``Result ID`` as a parameter to the methods that access the results of * - ``means`` - Pointer to the :math:`k \times p` numeric table with each row containing the estimate of the means for the :math:`i`-th mixture component, where :math:`i=0, 1, \ldots, k-1`. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -276,11 +271,11 @@ Pass the ``Result ID`` as a parameter to the methods that access the results of each with the :math:`p \times p` variance-covariance matrix for the :math:`i`-th mixture component of size: - + :math:`p \times p` - for the full covariance matrix storage scheme - + :math:`1 \times p` - for the diagonal covariance matrix storage scheme + + :math:`p \times p` - for the full covariance matrix storage scheme + + :math:`1 \times p` - for the diagonal covariance matrix storage scheme .. note:: - + By default, the collection contains objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``CSRNumericTable``. @@ -297,10 +292,13 @@ Algorithm Input The EM for GMM algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Expectation-Maximization Computaion (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Input ID - Input @@ -318,8 +316,8 @@ Pass the ``Input ID`` as a parameter to the methods that provide input for your - Pointer to the ``DataCollection`` object that contains :math:`k` numeric tables, each with the :math:`p \times p` variance-covariance matrix for the :math:`i`-th mixture component of size: - + :math:`p \times p` - for the full covariance matrix storage scheme - + :math:`1 \times p` - for the diagonal covariance matrix storage scheme + + :math:`p \times p` - for the full covariance matrix storage scheme + + :math:`1 \times p` - for the diagonal covariance matrix storage scheme The collection can contain objects of any class derived from NumericTable. @@ -335,10 +333,13 @@ Algorithm Parameters The EM for GMM algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Expectation-Maximization Computaion (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -361,9 +362,9 @@ The EM for GMM algorithm has the following parameters: * - ``covariance`` - Pointer to an object of the BatchIface class - Pointer to the algorithm that computes the covariance matrix. - + .. note:: - + By default, the respective |product| algorithm is used, implemented in the class derived from ``BatchIface``. * - ``regularizationFactor`` @@ -373,11 +374,11 @@ The EM for GMM algorithm has the following parameters: - ``full`` - Covariance matrix storage scheme in the Gaussian Mixture Model: - + ``full`` - covariance matrices are stored as numeric tables of size :math:`p \times p`. - All elements of the matrix are updated during the processing. + + ``full`` - covariance matrices are stored as numeric tables of size :math:`p \times p`. + All elements of the matrix are updated during the processing. - + ``diagonal`` - covariance matrices are stored as numeric tables of size :math:`1 \times p`. - Only diagonal elements of the matrix are updated during the processing, and the rest are assumed to be zero. + + ``diagonal`` - covariance matrices are stored as numeric tables of size :math:`1 \times p`. + Only diagonal elements of the matrix are updated during the processing, and the rest are assumed to be zero. Algorithm Output @@ -387,18 +388,21 @@ The EM for GMM algorithm calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Expectation-Maximization Computaion (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result * - ``weights`` - Pointer to the :math:`1 \times k` numeric table with mixture weights. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -407,7 +411,7 @@ of your algorithm. of the means for the :math:`i`-th mixture component, where :math:`i=0, 1, \ldots, k-1`. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -416,8 +420,8 @@ of your algorithm. - Pointer to the DataCollection object that contains :math:`k` numeric tables, each with the :math:`p \times p` variance-covariance matrix for the :math:`i`-th mixture component of size: - + :math:`p \times p` - for the full covariance matrix storage scheme - + :math:`1 \times p` - for the diagonal covariance matrix storage scheme + + :math:`p \times p` - for the full covariance matrix storage scheme + + :math:`1 \times p` - for the diagonal covariance matrix storage scheme .. note:: @@ -429,7 +433,7 @@ of your algorithm. * - ``goalFunction`` - Pointer to the :math:`1 \times 1` numeric table with the value of the logarithm of the likelihood function after the last iteration. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class. * - ``nIterations`` - Pointer to the :math:`1 \times 1` numeric table with the number of iterations @@ -449,7 +453,7 @@ Examples - :cpp_example:`em_gmm_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/engines/index.rst b/docs/source/daal/algorithms/engines/index.rst index cc9e7b620e3..0a631fd6cb0 100644 --- a/docs/source/daal/algorithms/engines/index.rst +++ b/docs/source/daal/algorithms/engines/index.rst @@ -18,7 +18,7 @@ Engines ======= Random number engines are used for uniformly distributed random numbers generation by using a seed - the initial -value that allows to select a particular random number sequence. +value that allows to select a particular random number sequence. Initialization is an engine-specific procedure. .. rubric:: Algorithm Input @@ -27,7 +27,9 @@ Engines accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Engines :widths: 10 60 :header-rows: 1 @@ -38,7 +40,7 @@ For more details, see :ref:`algorithms`. This input can be an object of any class derived from ``NumericTable`` except ``CSRNumericTable``, ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, - and ``MergedNumericTable`` when it holds one of the above table types. + and ``MergedNumericTable`` when it holds one of the above table types. .. rubric:: Algorithm Output @@ -46,7 +48,9 @@ Engines calculate the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Engines :widths: 10 60 :header-rows: 1 @@ -54,7 +58,7 @@ For more details, see :ref:`algorithms`. - Result * - ``randomNumbers`` - Pointer to the :math:`n \times p` numeric table with generated random floating-point values of single or double precision. - + In |short_name|, engines are in-place, which means that the algorithm does not allocate memory for the distribution result, but returns pointer to the filled input. @@ -67,29 +71,38 @@ The following methods that support generation of sequences of random numbers in Family Engines follow the same algorithmic scheme with different algorithmic parameters. The set of the parameters guarantee independence of random number sequences produced by the engines. - + The example below demonstrates the idea for the case when 2 engines from the same family are used to generate 2 random sequences: - .. image:: images/englines-family-method-example.jpg + .. figure:: images/englines-family-method-example.jpg :width: 300 + :alt: Generating two sequences independently with two engines + + Family method of random sequence generation SkipAhead This method skips ``nskip`` elements of the original random sequence. This method allows to produce ``nThreads`` non-overlapping subsequences. - + The example below demonstrates the idea for the case when 2 subsequences are used from the random sequence: - .. image:: images/englines-skipahead-method-example.jpg + .. figure:: images/englines-skipahead-method-example.jpg :width: 300 + :alt: Generating a subsequence by skipping nSkip elements + + SkipAhead method of random sequence generation LeapFrog - This method generates random numbers with a stride of ``nThreads``. + This method generates random numbers with a stride of ``nThreads``. ``threadIdx`` is an index of the current thread. - + The example below demonstrates the idea for the case when 2 subsequences are used from the random sequence: - .. image:: images/englines-leapfrog-method-example.jpg + .. figure:: images/englines-leapfrog-method-example.jpg :width: 300 + :alt: Generating a subsequence with stride=2 + + LeapFrog method of random sequence generation These methods are represented with member functions of classes that represent functionality described in the Engines section. See API References for details. @@ -97,7 +110,7 @@ These methods are represented with member functions of classes that represent fu .. toctree:: :maxdepth: 1 - + mt19937.rst mcg59.rst mt2203.rst diff --git a/docs/source/daal/algorithms/engines/mcg59.rst b/docs/source/daal/algorithms/engines/mcg59.rst index 145ec02389c..03a7d134475 100644 --- a/docs/source/daal/algorithms/engines/mcg59.rst +++ b/docs/source/daal/algorithms/engines/mcg59.rst @@ -36,10 +36,13 @@ The seed can be either an integer scalar or a vector of :math:`p` integer elemen MCG59 engine has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for mcg58 engine (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -51,7 +54,7 @@ MCG59 engine has the following parameters: - ``defaultDense`` - Performance-oriented computation method; the only method supported by the algorithm. * - ``seed`` - - + - - :math:`777` for a scalar seed - NA for a vector seed - Initial condition for state initialization, scalar or vector: diff --git a/docs/source/daal/algorithms/engines/mt19937.rst b/docs/source/daal/algorithms/engines/mt19937.rst index bcdaff03da2..21568958876 100644 --- a/docs/source/daal/algorithms/engines/mt19937.rst +++ b/docs/source/daal/algorithms/engines/mt19937.rst @@ -37,10 +37,13 @@ The seed can be either an integer scalar or a vector of :math:`p` integer elemen Mersenne Twister engine has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for mt19937 engine (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -52,7 +55,7 @@ Mersenne Twister engine has the following parameters: - ``defaultDense`` - Performance-oriented computation method; the only method supported by the algorithm. * - ``seed`` - - + - - :math:`777` for a scalar seed - NA for a vector seed - Initial condition for state initialization, scalar or vector: diff --git a/docs/source/daal/algorithms/engines/mt2203.rst b/docs/source/daal/algorithms/engines/mt2203.rst index c3468d57d72..0beae747715 100644 --- a/docs/source/daal/algorithms/engines/mt2203.rst +++ b/docs/source/daal/algorithms/engines/mt2203.rst @@ -38,10 +38,13 @@ The seed can be either an integer scalar or a vector of :math:`p` integer elemen MT2203 engine has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for mt2203 engine (Batch Processing) :header-rows: 1 :widths: 10 20 30 :align: left + :class: longtable * - Parameter - Default Value @@ -53,7 +56,7 @@ MT2203 engine has the following parameters: - ``defaultDense`` - Performance-oriented computation method; the only method supported by the algorithm. * - ``seed`` - - + - - :math:`777` for a scalar seed - NA for a vector seed - Initial condition for state initialization, scalar or vector: diff --git a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-classification.rst b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-classification.rst index e7ca89cbbb1..254a2dd5545 100644 --- a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-classification.rst +++ b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-classification.rst @@ -107,7 +107,7 @@ Examples - :cpp_example:`gbt_cls_traversed_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`GbtClsTraversedModelBuilder.java ` @@ -129,10 +129,13 @@ In addition to parameters of the gradient boosted trees described in :ref:`gb_trees_batch`, the gradient boosted trees classification training algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Gradient Boosted Trees Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -157,10 +160,13 @@ Prediction In addition to the parameters of a classifier, the gradient boosted trees classifier has the following parameters at the prediction stage: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Gradient Boosted Trees Classification (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -193,7 +199,7 @@ Examples - :cpp_example:`gbt_cls_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-regression.rst b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-regression.rst index 5abc4458001..bd2cd53fb20 100644 --- a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-regression.rst +++ b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees-regression.rst @@ -69,7 +69,7 @@ of Gradient Boosted Tree Regression, complete the following steps: Each tree consists of internal nodes (called non-leaf or split nodes) and external nodes (leaf nodes). Each split node denotes a feature test that is a Boolean expression, for example, f < ``featureValue`` or f = ``featureValue``, where f is a feature and ``featureValue`` is a constant. - The test type depends on the feature type: continuous, categorical, or ordinal. + The test type depends on the feature type: continuous, categorical, or ordinal. For more information on the test types, see :ref:`decision_tree`. The inducted decision tree is a binary tree, meaning that each non-leaf node has exactly two branches: true and false. @@ -90,7 +90,7 @@ Examples - :cpp_example:`gbt_reg_traversed_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`GbtRegTraversedModelBuilder.java ` @@ -113,10 +113,13 @@ In addition to parameters of the gradient boosted trees described in :ref:`gb_tr the gradient boosted trees regression training algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Gradient Boosted Trees Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -137,10 +140,13 @@ Prediction In addition to the common regression parameters, the gradient boosted trees regression has the following parameters at the prediction stage: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Gradient Boosted Trees Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -163,13 +169,13 @@ Examples .. tabs:: .. tab:: C++ (CPU) - + Batch Processing: - :cpp_example:`gbt_reg_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees.rst b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees.rst index eea447adab7..85c1cc0b389 100644 --- a/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees.rst +++ b/docs/source/daal/algorithms/gradient_boosted_trees/gradient-boosted-trees.rst @@ -67,17 +67,17 @@ algorithm does the following: - For :math:`k = 1, \ldots , M`: - - Update :math:`g_i` and :math:`h_i`, :math:`i = 1, \ldots, n` + - Update :math:`g_i` and :math:`h_i`, :math:`i = 1, \ldots, n` - - Grow a regression tree :math:`{f}_{k}\in F` that minimizes the objective function - :math:`-\frac{1}{2}\sum _{j=1}^{T}\frac{{G}_{j}^{2}}{{H}_{j}+\lambda }+\gamma T`, where - :math:`G_j=\sum _{i\in {I}_{j}}{g}_{j}`, :math:`{H}_{j}=\sum _{i\in {I}_{j}}{h}_{j}`, :math:`{I}_{j}= \{i| ({x}_{i})=j\}`, :math:`j=1, \ldots, T`. + - Grow a regression tree :math:`{f}_{k}\in F` that minimizes the objective function + :math:`-\frac{1}{2}\sum _{j=1}^{T}\frac{{G}_{j}^{2}}{{H}_{j}+\lambda }+\gamma T`, where + :math:`G_j=\sum _{i\in {I}_{j}}{g}_{j}`, :math:`{H}_{j}=\sum _{i\in {I}_{j}}{h}_{j}`, :math:`{I}_{j}= \{i| ({x}_{i})=j\}`, :math:`j=1, \ldots, T`. - - Assign an optimal weight :math:`{w_j}^{*}= \frac{G_j}{H_j +\lambda }` to the leaf :math:`j`, :math:`j = 1, \ldots, T`. + - Assign an optimal weight :math:`{w_j}^{*}= \frac{G_j}{H_j +\lambda }` to the leaf :math:`j`, :math:`j = 1, \ldots, T`. - - Apply shrinkage parameter :math:`\theta` to the tree leafs and add the tree to the model + - Apply shrinkage parameter :math:`\theta` to the tree leafs and add the tree to the model - - Update :math:`\hat{y_i}^{(k)}` + - Update :math:`\hat{y_i}^{(k)}` The algorithm for growing the tree: @@ -90,12 +90,12 @@ The algorithm for growing the tree: - For each leaf node in the tree: - - Choose a subset of feature for split finding if required (stochastic gradient boosting). + - Choose a subset of feature for split finding if required (stochastic gradient boosting). - - Find the best split that maximizes the gain: + - Find the best split that maximizes the gain: - .. math:: - \frac{{G}_{L}^{2}}{{H}_{L}+\lambda }+ \frac{{G}_{R}^{2}}{{H}_{R}+\lambda }- \frac{{({G}_{L}+{G}_{R})}^{2}}{{H}_{L}+ {H}_{R}+\lambda }- \gamma   + .. math:: + \frac{{G}_{L}^{2}}{{H}_{L}+\lambda }+ \frac{{G}_{R}^{2}}{{H}_{R}+\lambda }- \frac{{({G}_{L}+{G}_{R})}^{2}}{{H}_{L}+ {H}_{R}+\lambda }- \gamma   - Stop when a termination criterion is met. @@ -154,10 +154,13 @@ For description of the input and output, refer to . At the training stage, the gradient boosted trees batch algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Gradient Boosted Trees (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -168,8 +171,8 @@ has the following parameters: Possible values: - + ``inexact`` - continuous features are bucketed into discrete bins and the buckets borders are examined only - + ``exact`` - all possible splits for a given feature are examined + + ``inexact`` - continuous features are bucketed into discrete bins and the buckets borders are examined only + + ``exact`` - all possible splits for a given feature are examined * - ``maxIterations`` - :math:`50` diff --git a/docs/source/daal/algorithms/implicit_als/computation-batch.rst b/docs/source/daal/algorithms/implicit_als/computation-batch.rst index fb86c76970b..86617cddeaa 100644 --- a/docs/source/daal/algorithms/implicit_als/computation-batch.rst +++ b/docs/source/daal/algorithms/implicit_als/computation-batch.rst @@ -19,10 +19,6 @@ Batch Processing ================ -.. contents:: - :local: - :depth: 1 - Training ******** @@ -30,10 +26,13 @@ For a description of the input and output, refer to :ref:`recommendation_system_ At the training stage, the implicit ALS recommender has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Implicit Alternating Least Squares Computaion (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -71,10 +70,13 @@ For a description of the input and output, refer to :ref:`recommendation_system_ At the prediction stage, the implicit ALS recommender has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Implicit Alternating Least Squares Computaion (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/implicit_als/computation-distributed-prediction.rst b/docs/source/daal/algorithms/implicit_als/computation-distributed-prediction.rst index 964511b5068..33800d2984e 100644 --- a/docs/source/daal/algorithms/implicit_als/computation-distributed-prediction.rst +++ b/docs/source/daal/algorithms/implicit_als/computation-distributed-prediction.rst @@ -21,20 +21,19 @@ Distributed Processing: Prediction of Ratings The distributed processing mode assumes that the data set is split in ``nblocks`` blocks across computation nodes. -.. contents:: - :local: - :depth: 1 - Algorithm Parameters ******************** At the prediction stage, implicit ALS recommender in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Implicit Alternating Least Squares Computaion (Distributed Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -42,7 +41,7 @@ At the prediction stage, implicit ALS recommender in the distributed processing * - ``computeStep`` - Not applicable - The parameter required to initialize the algorithm. Can be: - + - ``step1Local`` - the first step, performed on local nodes * - ``algorithmFPType`` - ``float`` @@ -65,17 +64,23 @@ and item factors :math:`Y_1, Y_2, \ldots, Y_{\mathrm{nblocks}}` produced at the Each pair of partial models :math:`(X_i , Y_j)` is used to compute a numeric table with ratings :math:`R_{ij}` that correspond to the user factors and item factors from the input partial models. -.. image:: images/implicit-als-distributed-computation-prediction-step-1.png +.. figure:: images/implicit-als-distributed-computation-prediction-step-1.png :width: 800 :align: center - + :alt: + + Prediction with Implicit Alternating Least Squares: Distributed Processing, Step 1 - on Local Nodes + In this step, implicit ALS recommender-based prediction accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -90,7 +95,9 @@ In this step, implicit ALS recommender-based prediction calculates the result de Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 :align: left @@ -99,7 +106,7 @@ For more details, see :ref:`algorithms`. - Result * - ``prediction`` - Pointer to the :math:`m_i \times n_j` numeric table with predicted ratings. - + .. note:: By default this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` diff --git a/docs/source/daal/algorithms/implicit_als/computation-distributed-training.rst b/docs/source/daal/algorithms/implicit_als/computation-distributed-training.rst index 497a2e5228f..c20564d243a 100644 --- a/docs/source/daal/algorithms/implicit_als/computation-distributed-training.rst +++ b/docs/source/daal/algorithms/implicit_als/computation-distributed-training.rst @@ -21,19 +21,18 @@ Distributed Processing: Training The distributed processing mode assumes that the data set is split in ``nblocks`` blocks across computation nodes. -.. contents:: - :local: - :depth: 1 - Algorithm Parameters ******************** At the training stage, implicit ALS recommender in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Implicit Alternating Least Squares Computaion (Distributed Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -41,7 +40,7 @@ At the training stage, implicit ALS recommender in the distributed processing mo * - ``computeStep`` - Not applicable - The parameter required to initialize the algorithm. Can be: - + - ``step1Local`` - the first step, performed on local nodes - ``step2Master`` - the second step, performed on a master node - ``step3Local`` - the third step, performed on local nodes @@ -84,13 +83,19 @@ Each part includes four steps executed either on local nodes or on the master no as explained below and illustrated by graphics for :math:`\mathrm{nblocks} = 3`. The main loop of the implicit ALS training stage is executed on the master node. -.. image:: images/implicit-als-distributed-computation-training-general-scheme-1.png +.. figure:: images/implicit-als-distributed-computation-training-general-scheme-1.png :width: 600 :align: center + :alt: -.. image:: images/implicit-als-distributed-computation-training-general-scheme-2.png + Implicit Alternating Least Squares Computaion: Part 1 + +.. figure:: images/implicit-als-distributed-computation-training-general-scheme-2.png :width: 600 :align: center + :alt: + + Implicit Alternating Least Squares Computaion: Part 2 .. _implicit_als_distributed_training_step_1: @@ -104,15 +109,20 @@ This step works with the matrix: Parts of this matrix are used as input partial models. -.. image:: images/implicit-als-distributed-computation-training-step-1.png +.. figure:: images/implicit-als-distributed-computation-training-step-1.png :width: 600 :align: center + :alt: + + Training with Implicit Alternating Least Squares: Distributed Processing, Step 1 - on Local Nodes In this step, implicit ALS recommender training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -125,7 +135,9 @@ In this step, implicit ALS recommender training calculates the result described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 :align: left @@ -143,15 +155,20 @@ Step 2 - on Master Node This step uses local partial results from :ref:`Step 1 ` as input. -.. image:: images/implicit-als-distributed-computation-training-step-2.png +.. figure:: images/implicit-als-distributed-computation-training-step-2.png :width: 600 :align: center + :alt: + + Training with Implicit Alternating Least Squares: Distributed Processing, Step 2 - on Master Node In this step, implicit ALS recommender training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -159,7 +176,7 @@ For more details, see :ref:`algorithms`. - Input * - ``inputOfStep2FromStep1`` - A collection of numeric tables computed on local nodes in :ref:`Step 1 `. - + .. note:: The collection may contain objects of any class derived from ``NumericTable`` except the ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. @@ -168,7 +185,9 @@ In this step, implicit ALS recommender training calculates the result described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 :align: left @@ -199,17 +218,23 @@ The Input Of Step 3 From Init is a key-value data collection that refers to the - Output of the :ref:`step 1 of the distributed initialization algorithm ` in :ref:`part 1 ` of the iteration - Output of the :ref:`step 2 of the distributed initialization algorithm ` in :ref:`part 2 ` of the iteration -.. image:: images/implicit-als-distributed-computation-training-step-3.png +.. figure:: images/implicit-als-distributed-computation-training-step-3.png :width: 600 :align: center + :alt: + + Training with Implicit Alternating Least Squares: Distributed Processing, Step 3 - on Local Nodes In this step, implicit ALS recommender training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -223,7 +248,9 @@ In this step, implicit ALS recommender training calculates the result described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 :align: left @@ -232,7 +259,7 @@ For more details, see :ref:`algorithms`. - Result * - ``outputOfStep3ForStep4`` - A key-value data collection that contains partial models to be used in :ref:`Step 4 `. - Each element of the collection contains an object of the ``PartialModel`` class. + Each element of the collection contains an object of the ``PartialModel`` class. .. _implicit_als_distributed_training_step_4: @@ -246,17 +273,23 @@ This step uses the results of the previous steps and parts of the following matr The results of the step are the re-computed parts of this matrix. -.. image:: images/implicit-als-distributed-computation-training-step-4.png +.. figure:: images/implicit-als-distributed-computation-training-step-4.png :width: 600 :align: center + :alt: + + Training with Implicit Alternating Least Squares: Distributed Processing, Step 4 - on Local Nodes In this step, implicit ALS recommender training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 4) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -265,18 +298,21 @@ For more details, see :ref:`algorithms`. computed in :ref:`Step 3 `. Each element of the collection contains an object of the ``PartialModel`` class. * - ``partialData`` - - Pointer to the CSR numeric table that holds the :math:`i`-th part of the input data set, assuming that the data is divided by users/items. + - Pointer to the CSR numeric table that holds the :math:`i`-th part of the input data set, assuming that the data is divided by users/items. * - ``inputOfStep4FromStep2`` - Pointer to the :math:`f \times f` numeric table computed in :ref:`Step 2 `. - + In this step, implicit ALS recommender training calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Computaion (Distributed Processing, Step 4) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result diff --git a/docs/source/daal/algorithms/implicit_als/implicit-alternating-least-squares.rst b/docs/source/daal/algorithms/implicit_als/implicit-alternating-least-squares.rst index 852de23c362..532469d961c 100644 --- a/docs/source/daal/algorithms/implicit_als/implicit-alternating-least-squares.rst +++ b/docs/source/daal/algorithms/implicit_als/implicit-alternating-least-squares.rst @@ -58,7 +58,7 @@ by minimizing the following cost function: where: - :math:`{p}_{ui}` indicates the preference of user u of item i: - + .. math:: p_{ui} = \begin{cases} 1, & {r}_{ui}> \epsilon \\ @@ -90,7 +90,7 @@ For initialization, the following computation modes are available: .. toctree:: :maxdepth: 1 - + initialization-batch.rst initialization-distributed.rst @@ -127,11 +127,11 @@ Examples - :cpp_example:`impl_als_csr_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`ImplAlsDenseBatch.java ` - :java_example:`ImplAlsCSRBatch.java ` @@ -142,7 +142,7 @@ Examples .. tab:: Python* Batch Processing: - + - :daal4py_example:`implicit_als_batch.py` diff --git a/docs/source/daal/algorithms/implicit_als/initialization-batch.rst b/docs/source/daal/algorithms/implicit_als/initialization-batch.rst index d381832c844..07316454b6e 100644 --- a/docs/source/daal/algorithms/implicit_als/initialization-batch.rst +++ b/docs/source/daal/algorithms/implicit_als/initialization-batch.rst @@ -17,10 +17,6 @@ Batch Processing ================ -.. contents:: - :local: - :depth: 1 - Input ***** @@ -28,7 +24,9 @@ Initialization of item factors for the implicit ALS algorithm accepts the input Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -37,7 +35,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`m \times n` numeric table with the mining data. - + The input can be an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. @@ -46,10 +44,13 @@ Parameters Initialization of item factors for the implicit ALS algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Parameters for Implicit Alternating Least Squares Initialization (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -78,7 +79,9 @@ Initialization of item factors for the implicit ALS algorithm calculates the res Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left diff --git a/docs/source/daal/algorithms/implicit_als/initialization-distributed.rst b/docs/source/daal/algorithms/implicit_als/initialization-distributed.rst index 20a943270c8..bcc19c8bb01 100644 --- a/docs/source/daal/algorithms/implicit_als/initialization-distributed.rst +++ b/docs/source/daal/algorithms/implicit_als/initialization-distributed.rst @@ -19,19 +19,18 @@ Distributed Processing The distributed processing mode assumes that the data set R is split in ``nblocks`` blocks across computation nodes. -.. contents:: - :local: - :depth: 1 - Parameters ********** In the distributed processing mode, initialization of item factors for the implicit ALS algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Parameters for Implicit Alternating Least Squares Initialization (Distributed Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -59,18 +58,25 @@ In the distributed processing mode, initialization of item factors for the impli To initialize the implicit ALS algorithm in the distributed processing mode, use the one-step process illustrated by the following diagram for :math:`\mathrm{nblocks} = 3`: -.. image:: images/implicit-als-distributed-init-general-scheme.png +.. figure:: images/implicit-als-distributed-init-general-scheme.png :width: 600 :align: center + :alt: + + Implicit Alternating Least Squares Initialization: General Schema of Distributed Processing .. _implicit_als_distributed_init_step_1: Step 1 - on Local Nodes *********************** -.. image:: images/implicit-als-distributed-init-step-1.png +.. figure:: images/implicit-als-distributed-init-step-1.png :width: 600 :align: center + :alt: + + Implicit Alternating Least Squares Initialization: Distributed Processing, Step 1 - on Local Nodes + Input ----- @@ -79,7 +85,9 @@ In the distributed processing mode, initialization of item factors for the impli Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Initialization (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -88,7 +96,7 @@ For more details, see :ref:`algorithms`. * - ``dataColumnSlice`` - An :math:`n_i \times m` numeric table with the part of the input data set. Each node holds :math:`n_i` rows of the full transposed input data set :math:`R^T`. - + The input should be an object of ``CSRNumericTable`` class. Output @@ -111,9 +119,12 @@ that contains the value of the starting offset of the user factors stored on the For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Initialization (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result @@ -133,16 +144,22 @@ For more details, see :ref:`algorithms`. Step 2 - on Local Nodes *********************** -.. image:: images/implicit-als-distributed-init-step-2.png +.. figure:: images/implicit-als-distributed-init-step-2.png :width: 600 :align: center + :alt: + + Implicit Alternating Least Squares Initialization: Distributed Processing, Step 2 - on Local Nodes + Input ----- This step uses the results of the previous step. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Implicit Alternating Least Squares Initialization (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 @@ -173,9 +190,12 @@ that contains the value of the starting offset of the item factors stored on the For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Implicit Alternating Least Squares Initialization (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result diff --git a/docs/source/daal/algorithms/k_nearest_neighbors/k-nearest-neighbors-knn-classifier.rst b/docs/source/daal/algorithms/k_nearest_neighbors/k-nearest-neighbors-knn-classifier.rst index 4e0c72cffb5..2aa2b5fab80 100644 --- a/docs/source/daal/algorithms/k_nearest_neighbors/k-nearest-neighbors-knn-classifier.rst +++ b/docs/source/daal/algorithms/k_nearest_neighbors/k-nearest-neighbors-knn-classifier.rst @@ -136,7 +136,7 @@ Prediction Stage ---------------- Given kNN classifier and query vectors :math:`x_0, \ldots, x_r`, -the problem is to calculate the labels for those vectors. +the problem is to calculate the labels for those vectors. Prediction using K-D Tree +++++++++++++++++++++++++ @@ -176,10 +176,13 @@ For a description of the input and output, refer to Usage Model: Training and Pr At the training stage, both Brute Force and K-D tree based kNN classifier have the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for k-Nearest Neighbors Classifier (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -199,9 +202,9 @@ following parameters: - A parameter to enable/disable use of the input data set in the kNN model. Possible values: - + ``doNotUse`` - the algorithm does not include the input data and labels - in the trained kNN model but creates a copy of the input data set. - + ``doUse`` - the algorithm includes the input data and labels in the trained kNN model. + + ``doNotUse`` - the algorithm does not include the input data and labels + in the trained kNN model but creates a copy of the input data set. + + ``doUse`` - the algorithm includes the input data and labels in the trained kNN model. K-D tree based kNN reorders feature vectors and corresponding labels in the input data set or its copy to improve performance at the prediction stage. @@ -221,10 +224,13 @@ For a description of the input and output, refer to Usage Model: Training and Pr At the prediction stage, both Brute Force and K-D tree based kNN classifier have the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for k-Nearest Neighbors Classifier (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -264,25 +270,28 @@ Output In addition to classifier output, kNN calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the result of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for k-Nearest Neighbors Classifier (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result - * - ``indices`` + * - ``indices`` - A numeric table :math:`n \times k` containing indices of rows from training dataset that are nearest neighbors computed when the ``computeIndicesOfNeigtbors`` option is on. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable``. * - ``distances`` - A numeric table :math:`n \times k` containing distances to nearest neighbors computed when the ``computeDistances`` option is on. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable``. @@ -296,7 +305,7 @@ Examples Batch Processing: - :ref:`dpc_knn_cls_brute_force_dense_batch.cpp` - + .. tab:: oneAPI C++ Batch Processing: @@ -311,7 +320,7 @@ Examples - :cpp_example:`bf_knn_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/kernel_function/kernel-functions.rst b/docs/source/daal/algorithms/kernel_function/kernel-functions.rst index 61c1747f923..4b9b1598824 100644 --- a/docs/source/daal/algorithms/kernel_function/kernel-functions.rst +++ b/docs/source/daal/algorithms/kernel_function/kernel-functions.rst @@ -62,10 +62,13 @@ The linear kernel function accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Linear Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 + :class: longtable * - Input ID - Input @@ -79,10 +82,13 @@ Algorithm Parameters The linear kernel function has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Linear Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 10 60 + :class: longtable * - Parameter - Default Value @@ -105,12 +111,12 @@ The linear kernel function has the following parameters: + ``vectorVector`` - compute the kernel function for given feature vectors :math:`x_i` and :math:`y_j` + ``matrixVector`` - compute the kernel function for all vectors in the set :math:`X` and a given feature vector :math:`y_j` - + ``matrixMatrix`` - compute the kernel function for all vectors in the sets :math:`X` and :math:`Y`. + + ``matrixMatrix`` - compute the kernel function for all vectors in the sets :math:`X` and :math:`Y`. In |product|, this mode requires equal numbers of observations in both input tables: :math:`n = m`. For GPU: - + ``matrixMatrix`` - compute the kernel function for all vectors in the sets :math:`X` and :math:`Y`. + + ``matrixMatrix`` - compute the kernel function for all vectors in the sets :math:`X` and :math:`Y`. In |product|, this mode requires equal numbers of observations in both input tables: :math:`n = m`. * - ``rowIndexX`` @@ -135,8 +141,9 @@ Algorithm Output The linear kernel function calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| -.. list-table:: +.. list-table:: Algorithm Output for Linear Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 @@ -146,9 +153,9 @@ Pass the ``Result ID`` as a parameter to the methods that access the results of * - ``values`` - Pointer to the :math:`n \times m` numeric table with the values of the kernel function. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -161,7 +168,7 @@ Examples .. tab:: oneAPI DPC++ Batch Processing: - + - :ref:`dpc_linear_kernel_dense_batch.cpp` .. tab:: oneAPI C++ @@ -178,7 +185,7 @@ Examples - :cpp_example:`kernel_func_lin_csr_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -219,10 +226,13 @@ The RBF kernel accepts the input described below. Pass the Input ID as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Radial Basis Function Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 + :class: longtable * - Input ID - Input @@ -236,10 +246,13 @@ Algorithm Parameters The RBF kernel has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Radial Basis Function Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 10 60 + :class: longtable * - Parameter - Default Value @@ -290,7 +303,9 @@ The RBF kernel calculates the results described below. Pass the Result ID as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Radial Basis Function Kernel (Batch Processing) :header-rows: 1 :align: left :widths: 10 60 @@ -302,7 +317,7 @@ your algorithm. function. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -333,7 +348,7 @@ Examples - :cpp_example:`kernel_func_rbf_csr_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/kmeans/computation-batch.rst b/docs/source/daal/algorithms/kmeans/computation-batch.rst index 9ebdc6109c0..626355125ad 100644 --- a/docs/source/daal/algorithms/kmeans/computation-batch.rst +++ b/docs/source/daal/algorithms/kmeans/computation-batch.rst @@ -19,11 +19,6 @@ Batch Processing **************** -.. contents:: - :local: - :depth: 1 - - Algorithm Input +++++++++++++++ @@ -31,11 +26,13 @@ The K-Means clustering algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| -.. list-table:: +.. list-table:: Algorithm Input for K-Means Computaion (Batch Processing) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Input ID - Input @@ -51,10 +48,13 @@ Algorithm Parameters The K-Means clustering algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for K-Means Computaion (Batch Processing) :header-rows: 1 :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -68,12 +68,12 @@ The K-Means clustering algorithm has the following parameters: For CPU: - - ``defaultDense`` - implementation of Lloyd's algorithm - - ``lloydCSR`` - implementation of Lloyd's algorithm for CSR numeric tables + - ``defaultDense`` - implementation of Lloyd's algorithm + - ``lloydCSR`` - implementation of Lloyd's algorithm for CSR numeric tables For GPU: - - ``defaultDense`` - implementation of Lloyd's algorithm + - ``defaultDense`` - implementation of Lloyd's algorithm * - ``nClusters`` - Not applicable @@ -91,7 +91,7 @@ The K-Means clustering algorithm has the following parameters: - ``euclidean`` - The measure of closeness between points (observations) being clustered. The only distance type supported so far is the Euclidian distance. * - **DEPRECATED:** ``assignFlag`` - + **USE INSTEAD:** ``resultsToEvaluate`` - ``true`` @@ -99,9 +99,9 @@ The K-Means clustering algorithm has the following parameters: * - ``resultsToEvaluate`` - ``computeCentroids`` | ``computeAssignments`` | ``computeExactObjectiveFunction`` - The 64-bit integer flag that specifies which extra characteristics of the K-Means algorithm to compute. - + Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics: - + - ``computeCentroids`` for computation centroids. - ``computeAssignments`` for computation of assignments, that is, assigning cluster indices to respective observations. - ``computeExactObjectiveFunction`` for computation of exact ObjectiveFunction. @@ -114,10 +114,13 @@ The K-Means clustering algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for K-Means Computaion (Batch Processing) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Result ID - Result @@ -133,7 +136,7 @@ the results of your algorithm. Pointer to the :math:`n \times 1` numeric table with assignments of cluster indices to feature vectors in the input data, computed when ``computeAssignments`` option is enabled. - + .. include:: ./../../includes/default_result_numeric_table.rst * - ``objectiveFunction`` @@ -148,7 +151,7 @@ the results of your algorithm. - Pointer to the :math:`1 \times 1` numeric table with the actual number of iterations done by the algorithm. - + .. include:: ./../../includes/default_result_numeric_table.rst .. note:: diff --git a/docs/source/daal/algorithms/kmeans/computation-distributed.rst b/docs/source/daal/algorithms/kmeans/computation-distributed.rst index 40d0185247c..f77c558a8a4 100644 --- a/docs/source/daal/algorithms/kmeans/computation-distributed.rst +++ b/docs/source/daal/algorithms/kmeans/computation-distributed.rst @@ -19,19 +19,18 @@ Distributed Processing This mode assumes that the data set is split into ``nblocks`` blocks across computation nodes. -.. contents:: - :local: - :depth: 1 - Algorithm Parameters ++++++++++++++++++++ The K-Means clustering algorithm in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for K-Means Computaion (Distributed Processing) :header-rows: 1 :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -73,17 +72,23 @@ To compute K-Means clustering in the distributed processing mode, use the genera Step 1 - on Local Nodes +++++++++++++++++++++++ -.. image:: images/kmeans-distributed-computation-step-1.png +.. figure:: images/kmeans-distributed-computation-step-1.png :width: 1000 + :alt: + + K-Means Computaion: Distributed Processing, Step 1 - on Local Nodes In this step, the K-Means clustering algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Computaion (Distributed Processing, Step 1) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Input ID - Input @@ -98,24 +103,27 @@ In this step, the K-Means clustering algorithm calculates the partial results an Pass the ``Partial Result ID`` or ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for K-Means Computaion (Distributed Processing, Step 1) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Partial Result ID - Result * - ``nObservations`` - Pointer to the :math:`\mathrm{nClusters} \times 1` numeric table that contains - the number of observations assigned to the clusters on local node. - + the number of observations assigned to the clusters on local node. + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``partialSums`` - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with partial sums of observations assigned to the clusters on the local node. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` @@ -123,14 +131,14 @@ For more details, see :ref:`algorithms`. * - ``partialObjectiveFunction`` - Pointer to the :math:`1 \times 1` numeric table that contains the value of the partial objective function for observations processed on the local node. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``partialCandidatesDistances`` - Pointer to the :math:`\mathrm{nClusters} \times 1` numeric table that contains the value of the ``nClusters`` largest objective function for the observations processed on the local node and stored in descending order. - + .. note:: By default, this result if an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` @@ -139,12 +147,14 @@ For more details, see :ref:`algorithms`. - Pointer to the :math:`\mathrm{nClusters} \times 1` numeric table that contains the observations of the ``nClusters`` largest objective function value processed on the local node and stored in descending order of the objective function. - .. note:: + .. note:: By default, this result if an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Computaion (Distributed Processing, Step 1) :header-rows: 1 :widths: 10 60 :align: left @@ -154,7 +164,7 @@ For more details, see :ref:`algorithms`. * - ``assignments`` - Use when ``assignFlag`` = ``true``. Pointer to the :math:`n_i \times 1` numeric table with 32-bit integer assignments of cluster indices to feature vectors in the input data on the local node. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` @@ -165,14 +175,19 @@ For more details, see :ref:`algorithms`. Step 2 - on Master Node +++++++++++++++++++++++ -.. image:: images/kmeans-distributed-computation-step-2.png +.. figure:: images/kmeans-distributed-computation-step-2.png :width: 1000 + :alt: + + K-Means Computaion: Distributed Processing, Step 2 - on Master Node In this step, the K-Means clustering algorithm accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Computaion (Distributed Processing, Step 2) :header-rows: 1 :widths: 10 60 :align: left @@ -186,24 +201,27 @@ In this step, the K-Means clustering algorithm calculates the results described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Computaion (Distributed Processing, Step 2) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Result ID - Result * - ``centroids`` - - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. + - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. * - ``objectiveFunction`` - Pointer to the :math:`1 \times 1` numeric table that contains the value of the objective function. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define this result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/kmeans/initialization-batch.rst b/docs/source/daal/algorithms/kmeans/initialization-batch.rst index 287a6904cd0..8bdaee8235b 100644 --- a/docs/source/daal/algorithms/kmeans/initialization-batch.rst +++ b/docs/source/daal/algorithms/kmeans/initialization-batch.rst @@ -17,11 +17,6 @@ Batch Processing **************** -.. contents:: - :local: - :depth: 1 - - Input +++++ @@ -29,7 +24,9 @@ Centroid initialization for K-Means clustering accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for K-Means Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -49,11 +46,13 @@ The following table lists parameters of centroid initialization for K-Means clustering, which depend on the initialization method parameter method. +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| -.. list-table:: +.. list-table:: Algorithm Parameters for K-Means Initialization (Batch Processing) :widths: 10 10 10 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - method @@ -125,7 +124,9 @@ Centroid initialization for K-Means clustering calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for K-Means Initialization (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left diff --git a/docs/source/daal/algorithms/kmeans/initialization-distributed.rst b/docs/source/daal/algorithms/kmeans/initialization-distributed.rst index 0e632bc49cd..3fc685c7cdd 100644 --- a/docs/source/daal/algorithms/kmeans/initialization-distributed.rst +++ b/docs/source/daal/algorithms/kmeans/initialization-distributed.rst @@ -19,18 +19,17 @@ Distributed Processing This mode assumes that the data set is split into ``nblocks`` blocks across computation nodes. -.. contents:: - :local: - :depth: 1 - Parameters ++++++++++ Centroid initialization for K-Means clustering in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for K-Means Initialization (Distributed Processing) :widths: 10 10 10 30 :header-rows: 1 + :class: longtable * - Parameter - Method @@ -83,7 +82,7 @@ Centroid initialization for K-Means clustering in the distributed processing mod * ``parallelPlusDense`` * ``parallelPlusCSR`` - :math:`0.5` - - A fraction of ``nClusters`` in each of ``nRounds`` of parallel K-Means++. + - A fraction of ``nClusters`` in each of ``nRounds`` of parallel K-Means++. :math:`L = \mathrm{nClusters}*\mathrm{oversamplingFactor}` points are sampled in a round. For details, see [Bahmani2012]_, section 3.3. * - ``nRounds`` @@ -115,11 +114,17 @@ Centroid initialization for K-Means clustering follows the general schema descri .. tab:: ``plusPlus`` methods - .. image:: images/kmeans-distributed-init-plusPlus-methods.png + .. figure:: images/kmeans-distributed-init-plusPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``plusPlus`` methods: Distributed Processing .. tab:: ``parrallelPlus`` methods - .. image:: images/kmeans-distributed-init-parallelPlus-methods.png + .. figure:: images/kmeans-distributed-init-parallelPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing .. _kmeans_init_step_1: @@ -130,17 +135,25 @@ Step 1 - on Local Nodes (``deterministic``, ``random``, ``plusPlus``, and ``para .. tab:: ``plusPlus`` methods - .. image:: images/kmeans-distributed-init-step-1-plusPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-1-plusPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``plusPlus`` methods: Distributed Processing, Step 1 - on Local Nodes .. tab:: ``parrallelPlus`` methods - .. image:: images/kmeans-distributed-init-step-1-parallelPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-1-parallelPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing, Step 1 - on Local Nodes In this step, centroid initialization for K-Means clustering accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 1) :header-rows: 1 :widths: 10 60 :align: left @@ -149,7 +162,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. - + .. note:: While the input for ``defaultDense``, ``randomDense``, ``plusPlusDense``, and ``parallelPlusDense`` methods @@ -161,7 +174,9 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 1) :header-rows: 1 :widths: 10 60 :align: left @@ -170,9 +185,9 @@ For more details, see :ref:`algorithms`. - Result * - ``partialCentroids`` - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with the centroids computed on the local node. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -183,11 +198,13 @@ Step 2 - on Master Node (``deterministic`` and ``random`` methods) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This step is applicable for ``deterministic`` and ``random`` methods only. -Centroid initialization for K-Means clustering accepts the input from each local node described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Centroid initialization for K-Means clustering accepts the input from each local node described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 2 on Master Node) :header-rows: 1 :widths: 10 60 :align: left @@ -202,7 +219,9 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 2 on Master Node) :header-rows: 1 :widths: 10 60 :align: left @@ -210,10 +229,10 @@ For more details, see :ref:`algorithms`. * - Result ID - Result * - ``centroids`` - - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. + - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -227,26 +246,35 @@ Step 2 - on Local Nodes (``plusPlus`` and ``parallelPlus`` methods) .. tab:: ``plusPlus`` methods - .. image:: images/kmeans-distributed-init-step-2-plusPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-2-plusPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``plusPlus`` methods: Distributed Processing, Step 2 - on Local Nodes .. tab:: ``parrallelPlus`` methods - .. image:: images/kmeans-distributed-init-step-2-parallelPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-2-parallelPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing, Step 2 - on Local Nodes This step is applicable for ``plusPlus`` and ``parallelPlus`` methods only. Centroid initialization for K-Means clustering accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 1 on Local Nodes) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Input ID - Input * - ``data`` - - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. + - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. .. note:: @@ -258,21 +286,21 @@ For more details, see :ref:`algorithms`. * - ``inputOfStep2`` - Pointer to the :math:`m \times p` numeric table with the centroids calculated in the previous steps (:ref:`Step 1 ` or :ref:`Step 4 `). - + The value of :math:`m` is defined by the method and iteration of the algorithm: - + - ``plusPlus`` method: :math:`m = 1` - ``parallelPlus`` method: - - - :math:`m = 1` for the first iteration of the Step 2 - Step 4 loop - - :math:`m = L = \mathrm{nClusters} * \mathrm{oversamplingFactor}` for other iterations + + - :math:`m = 1` for the first iteration of the Step 2 - Step 4 loop + - :math:`m = L = \mathrm{nClusters} * \mathrm{oversamplingFactor}` for other iterations This input can be an object of any class derived from ``NumericTable``, except ``CSRNumericTable``, ``PackedTriangularMatrix``, and ``PackedSymmetricMatrix``. * - ``internalInput`` - Pointer to the ``DataCollection`` object with the internal data of the distributed algorithm - used by its local nodes in :ref:`Step 2 ` and :ref:`Step 4 `. + used by its local nodes in :ref:`Step 2 ` and :ref:`Step 4 `. The ``DataCollection`` is created in :ref:`Step 2 ` when ``firstIteration`` is set to ``true``, and then the ``DataCollection`` should be set from the partial result as an input for next local steps (:ref:`Step 2 ` and :ref:`Step 4 `). @@ -281,10 +309,13 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 2 on Local Nodes) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Result ID - Result @@ -297,7 +328,7 @@ For more details, see :ref:`algorithms`. and :math:`m = \mathrm{oversamplingFactor} * \mathrm{nClusters} * \mathrm{nRounds} + 1`. For a description of ratings, see :ref:`K-Means Clustering Details `. -.. note:: +.. note:: By default, these results are objects of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` @@ -312,18 +343,26 @@ Step 3 - on Master Node (``plusPlus`` and ``parallelPlus`` methods) .. tab:: ``plusPlus`` methods - .. image:: images/kmeans-distributed-init-step-3-plusPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-3-plusPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``plusPlus`` methods: Distributed Processing, Step 3 - on Master Node .. tab:: ``parrallelPlus`` methods - .. image:: images/kmeans-distributed-init-step-3-parallelPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-3-parallelPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing, Step 3 - on Master Node This step is applicable for plusPlus and parallelPlus methods only. Centroid initialization for K-Means clustering accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 3) :header-rows: 1 :widths: 10 60 :align: left @@ -338,10 +377,13 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 3) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Result ID - Result @@ -368,27 +410,36 @@ Step 4 - on Local Nodes (``plusPlus`` and ``parallelPlus`` methods) .. tab:: ``plusPlus`` methods - .. image:: images/kmeans-distributed-init-step-4-plusPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-4-plusPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``plusPlus`` methods: Distributed Processing, Step 4 - on Local Nodes .. tab:: ``parrallelPlus`` methods - .. image:: images/kmeans-distributed-init-step-4-parallelPlus-methods.png + .. figure:: images/kmeans-distributed-init-step-4-parallelPlus-methods.png + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing, Step 4 - on Local Nodes This step is applicable for plusPlus and parallelPlus methods only. Centroid initialization for K-Means clustering accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 4) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Input ID - Input * - ``data`` - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. - + .. note:: While the input for ``defaultDense``, ``randomDense``, ``plusPlusDense``, and ``parallelPlusDense`` methods @@ -398,12 +449,12 @@ For more details, see :ref:`algorithms`. * - ``inputOfStep4FromStep3`` - Pointer to the :math:`l \times m` numeric table with the values calculated in :ref:`Step 3 `. - + The value of :math:`m` is defined by the method of the algorithm: - + - ``plusPlus`` method: :math:`m = 1` - ``parallelPlus`` method: :math:`m \leq L`, :math:`L = \mathrm{nClusters} * \mathrm{oversamplingFactor}` - + This input can be an object of any class derived from ``NumericTable``, except ``CSRNumericTable``, ``PackedTriangularMatrix``, and ``PackedSymmetricMatrix``. @@ -418,7 +469,9 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 4) :header-rows: 1 :widths: 10 60 :align: left @@ -428,9 +481,9 @@ For more details, see :ref:`algorithms`. * - ``outputOfStep4`` - Pointer to the :math:`m \times p` numeric table that contains centroids computed on this local node, where :math:`m` equals to the one in ``inputOfStep4FromStep3``. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``, ``PackedTriangularMatrix``, and ``PackedSymmetricMatrix``. @@ -440,18 +493,24 @@ For more details, see :ref:`algorithms`. Step 5 - on Master Node (``parallelPlus`` methods) ++++++++++++++++++++++++++++++++++++++++++++++++++ -.. image:: images/kmeans-distributed-init-step-5-parallelPlus-methods.png +.. figure:: images/kmeans-distributed-init-step-5-parallelPlus-methods.png :width: 1000 + :alt: + + K-Means Centroid Initialization with ``parrallelPlus`` methods: Distributed Processing, Step 5 - on Master Node This step is applicable for parallelPlus methods only. Centroid initialization for K-Means clustering accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for K-Means Initialization (Distributed Processing, Step 5) :header-rows: 1 :widths: 10 60 :align: left + :class: longtable * - Input ID - Input @@ -461,11 +520,11 @@ For more details, see :ref:`algorithms`. where the value of :math:`m` is defined by the method and the iteration of the algorithm: ``parallelPlus`` method: - + - :math:`m = 1` for the data added as the output of :ref:`Step 1 ` - :math:`m \leq L`, :math:`L = \mathrm{nClusters} * \mathrm{oversamplingFactor}` for the data added as the output of :ref:`Step 4 ` - + Each numeric table can be an object of any class derived from ``NumericTable``, except ``CSRNumericTable``, ``PackedTriangularMatrix``, and ``PackedSymmetricMatrix``. @@ -480,7 +539,9 @@ In this step, centroid initialization for K-Means clustering calculates the resu Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for K-Means Initialization (Distributed Processing, Step 5) :header-rows: 1 :widths: 10 60 :align: left @@ -488,10 +549,10 @@ For more details, see :ref:`algorithms`. * - Result ID - Result * - ``centroids`` - - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. + - Pointer to the :math:`\mathrm{nClusters} \times p` numeric table with centroids. .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/kmeans/k-means-clustering.rst b/docs/source/daal/algorithms/kmeans/k-means-clustering.rst index b083806ea1f..e24e2462c84 100644 --- a/docs/source/daal/algorithms/kmeans/k-means-clustering.rst +++ b/docs/source/daal/algorithms/kmeans/k-means-clustering.rst @@ -237,7 +237,7 @@ For initialization, the following computation modes are available: .. toctree:: :maxdepth: 1 - + initialization-batch.rst initialization-distributed.rst @@ -248,7 +248,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-distributed.rst @@ -286,7 +286,7 @@ Examples - :cpp_example:`kmeans_csr_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/lasso_elastic_net/elastic-net.rst b/docs/source/daal/algorithms/lasso_elastic_net/elastic-net.rst index 662171fd049..f1a24709793 100644 --- a/docs/source/daal/algorithms/lasso_elastic_net/elastic-net.rst +++ b/docs/source/daal/algorithms/lasso_elastic_net/elastic-net.rst @@ -26,7 +26,7 @@ Elastic Net Elastic Net is a method for modeling relationship between a dependent variable (which may be a vector) and one or more explanatory variables by fitting regularized least squares model. Elastic Net regression model has the special penalty, a sum of L1 and L2 regularizations, -that takes advantage of both :ref:`ridge` and :ref:`LASSO ` algorithms. +that takes advantage of both :ref:`ridge` and :ref:`LASSO ` algorithms. This penalty is particularly useful in a situation with many correlated predictor variables [Friedman2010]_. Details diff --git a/docs/source/daal/algorithms/lasso_elastic_net/lasso-elasticnet-computation.rst b/docs/source/daal/algorithms/lasso_elastic_net/lasso-elasticnet-computation.rst index a49986dcf7c..888acb21430 100644 --- a/docs/source/daal/algorithms/lasso_elastic_net/lasso-elasticnet-computation.rst +++ b/docs/source/daal/algorithms/lasso_elastic_net/lasso-elasticnet-computation.rst @@ -30,17 +30,20 @@ For a description of common input and output parameters, refer to :ref:`regression_usage_model`. Both LASSO and Elastic Net algorithms have the following input parameters in addition to the common input parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for LASSO and Elastic Net (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Input ID - Input * - ``weights`` - Optional input. - Pointer to the :math:`1 \times n` numeric table with weights of samples. + Pointer to the :math:`1 \times n` numeric table with weights of samples. The input can be an object of any class derived from NumericTable except for PackedTriangularMatrix, PackedSymmetricMatrix, and CSRNumericTable. @@ -49,10 +52,10 @@ Both LASSO and Elastic Net algorithms have the following input parameters in add * - ``gramMatrix`` - Optional input. - Pointer to the :math:`p \times p` numeric table with pre-computed Gram Matrix. + Pointer to the :math:`p \times p` numeric table with pre-computed Gram Matrix. The input can be an object of any class derived from NumericTable except for CSRNumericTable. - By default, the table is set to an empty numeric table. + By default, the table is set to an empty numeric table. It is used only when the number of features is less than the number of observations. Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net batch training algorithms: @@ -61,10 +64,13 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b .. group-tab:: LASSO - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + + .. list-table:: Training Parameters for LASSO (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -73,21 +79,21 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b - ``float`` - The floating-point type that the algorithm uses for intermediate computations. Can be ``float`` or ``double``. * - ``method`` - - ``defaultDense`` + - ``defaultDense`` - The computation method used by the LASSO regression. The only training method supported so far is the default dense method. * - ``interceptFlag`` - ``True`` - A flag that indicates whether or not to compute - * - ``lassoParameters`` + * - ``lassoParameters`` - A numeric table of size :math:`1 \times 1` that contains the default LASSO parameter equal to :math:`0.1`. - :math:`L_1` coefficients: :math:`\lambda_i` - A numeric table of size :math:`1 \times k` (where :math:`k` is the number of dependent variables) or :math:`1 \times 1`. + A numeric table of size :math:`1 \times k` (where :math:`k` is the number of dependent variables) or :math:`1 \times 1`. The contents of the table depend on its size: - For the table of size :math:`1 \times k`, use the values of LASSO parameters :math:`\lambda_j` for :math:`j = 1, \ldots, k`. - For the table of size :math:`1 \times 1`, use the value of LASSO parameter for each dependant variable :math:`\lambda_1 = \ldots = \lambda_k`. - + This parameter can be an object of any class derived from NumericTable, except for PackedTriangularMatrix, PackedSymmetricMatrix, and CSRNumericTable. @@ -104,7 +110,7 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b * - ``dataUseInComputation`` - ``doNotUse`` - - A flag that indicates a permission to overwrite input data. + - A flag that indicates a permission to overwrite input data. Provide the following value to restrict or allow modification of input data: - ``doNotUse`` – restricts modification @@ -112,10 +118,13 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b .. group-tab:: Elastic Net - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + + .. list-table:: Training Parameters for Elastic Net (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -124,7 +133,7 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b - ``float`` - The floating-point type that the algorithm uses for intermediate computations. Can be ``float`` or ``double``. * - ``method`` - - ``defaultDense`` + - ``defaultDense`` - The computation method used by the Elastic Net regression. The only training method supported so far is the default dense method. * - ``interceptFlag`` - ``True`` @@ -168,7 +177,7 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b * - ``dataUseInComputation`` - ``doNotUse`` - - A flag that indicates a permission to overwrite input data. + - A flag that indicates a permission to overwrite input data. Provide the following value to restrict or allow modification of input data: - ``doNotUse`` – restricts modification @@ -193,7 +202,9 @@ Chosse the appropriate tab to see the parameters used in LASSO and Elastic Net b In addition, both LASSO and Elastic Net algorithms have the following optional results: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for LASSO and Elastic Net (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -211,10 +222,13 @@ For a description of the input and output, refer to At the prediction stage, LASSO and Elastic Net algorithms have the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for LASSO and Elastic Net (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/lasso_elastic_net/lasso.rst b/docs/source/daal/algorithms/lasso_elastic_net/lasso.rst index 607cc5ced4c..87a5e84565f 100644 --- a/docs/source/daal/algorithms/lasso_elastic_net/lasso.rst +++ b/docs/source/daal/algorithms/lasso_elastic_net/lasso.rst @@ -63,7 +63,7 @@ by minimizing the objective function: .. math:: - F_j(\beta) = \frac{1}{2n} \sum_{i=1}^{n}(y_{ij} - \beta_{0j} - \sum_{q=1}^{p}{\beta_{qj}x_{iq})^2} + + F_j(\beta) = \frac{1}{2n} \sum_{i=1}^{n}(y_{ij} - \beta_{0j} - \sum_{q=1}^{p}{\beta_{qj}x_{iq})^2} + \lambda_{1j} \sum_{q=1}^{p}|\beta_{qj}| In the equation above, the first term is a mean squared error function and the second one is a regularization term that diff --git a/docs/source/daal/algorithms/linear_ridge_regression/linear-regression.rst b/docs/source/daal/algorithms/linear_ridge_regression/linear-regression.rst index 6cd865fb00d..71b7b21da1c 100644 --- a/docs/source/daal/algorithms/linear_ridge_regression/linear-regression.rst +++ b/docs/source/daal/algorithms/linear_ridge_regression/linear-regression.rst @@ -83,8 +83,8 @@ To build a Linear Regression model using methods of the Model Builder class of L Specify random access iterators to the first and the last element of the set of coefficients [ISO/IEC 14882:2011 §24.2.7]_. .. note:: - - If your set of coefficients does not contain an intercept, + + If your set of coefficients does not contain an intercept, ``interceptFlag`` is automatically set to ``False``, and to ``True``, otherwise. - Use the ``getModel`` method to get the trained Linear Regression model. @@ -107,7 +107,7 @@ Examples - :cpp_example:`lin_reg_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`LinRegModelBuilder.java ` diff --git a/docs/source/daal/algorithms/linear_ridge_regression/linear-ridge-regression-computation.rst b/docs/source/daal/algorithms/linear_ridge_regression/linear-ridge-regression-computation.rst index 738d9dbfc40..6dd484c92cc 100644 --- a/docs/source/daal/algorithms/linear_ridge_regression/linear-ridge-regression-computation.rst +++ b/docs/source/daal/algorithms/linear_ridge_regression/linear-ridge-regression-computation.rst @@ -17,11 +17,6 @@ Linear and Ridge Regressions Computation **************************************** -- `Batch Processing`_ -- `Online Processing`_ -- `Distributed Processing`_ -- `Examples`_ - Batch Processing ================ @@ -42,10 +37,13 @@ algorithm. .. group-tab:: Linear Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + + .. list-table:: Training Parameters for Linear Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -56,7 +54,7 @@ algorithm. * - ``method`` - ``defaultDense`` - Available methods for linear regression training: - + - ``defaultDense`` - the normal equations method - ``qrDense`` - the method based on QR decomposition @@ -66,10 +64,13 @@ algorithm. .. group-tab:: Ridge Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.25}|\Y{0.3}|\Y{0.45}| + + .. list-table:: Training Parameters for Ridge Regression (Batch Processing) :widths: 20 30 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -79,7 +80,7 @@ algorithm. - The floating-point type that the algorithm uses for intermediate computations. Can be ``float`` or ``double``. * - ``method`` - ``defaultDense`` - - Default computation method used by the ridge regression. + - Default computation method used by the ridge regression. The only method supported at the training stage is the normal equations method. * - ``ridgeParameters`` - A numeric table of size :math:`1 \times 1` that contains the default ridge parameter @@ -88,11 +89,11 @@ algorithm. or :math:`1 \times 1`. The contents of the table depend on its size: - :math:`size = 1 \times k`: values of the ridge parameters :math:`\lambda_j` for :math:`j = 1, \ldots, k`. - - :math:`size = 1 \times 1`: the value of the ridge parameter for each dependent variable + - :math:`size = 1 \times 1`: the value of the ridge parameter for each dependent variable :math:`\lambda_1 = \ldots = \lambda_k`. .. note:: - + This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -108,10 +109,13 @@ For a description of the input and output, refer to :ref:`regression_usage_model At the prediction stage, linear and ridge regressions have the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Linear and Ridge Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -140,9 +144,12 @@ Linear and ridge regression training in the online processing mode accepts the i Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Linear and Ridge Regression (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -159,10 +166,13 @@ The following table lists parameters of linear and ridge regressions at the trai .. group-tab:: Linear Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + + .. list-table:: Training Parameters for Linear Regression (Online Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -173,7 +183,7 @@ The following table lists parameters of linear and ridge regressions at the trai * - ``method`` - ``defaultDense`` - Available methods for linear regression training: - + - ``defaultDense`` - the normal equations method - ``qrDense`` - the method based on QR decomposition @@ -183,10 +193,13 @@ The following table lists parameters of linear and ridge regressions at the trai .. group-tab:: Ridge Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.25}|\Y{0.3}|\Y{0.45}| + + .. list-table:: Training Parameters for Ridge Regression (Online Processing) :widths: 20 30 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -242,10 +255,13 @@ The following table lists parameters of linear and ridge regressions at the trai .. group-tab:: Linear Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + + .. list-table:: Training Parameters for Linear Regression (Distributed Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -253,7 +269,7 @@ The following table lists parameters of linear and ridge regressions at the trai * - ``computeStep`` - Not applicable - The parameter required to initialize the algorithm. Can be: - + - ``step1Local`` - the first step, performed on local nodes - ``step2Master`` - the second step, performed on a master node @@ -263,20 +279,23 @@ The following table lists parameters of linear and ridge regressions at the trai * - ``method`` - ``defaultDense`` - Available methods for linear regression training: - + - ``defaultDense`` - the normal equations method - ``qrDense`` - the method based on QR decomposition * - ``interceptFlag`` - ``true`` - A flag that indicates a need to compute :math:`\beta_{0_j}`. - + .. group-tab:: Ridge Regression - .. list-table:: + .. tabularcolumns:: |\Y{0.25}|\Y{0.3}|\Y{0.45}| + + .. list-table:: Training Parameters for Ridge Regression (Distributed Processing) :widths: 20 30 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -284,7 +303,7 @@ The following table lists parameters of linear and ridge regressions at the trai * - ``computeStep`` - Not applicable - The parameter required to initialize the algorithm. Can be: - + - ``step1Local`` - the first step, performed on local nodes - ``step2Master`` - the second step, performed on a master node @@ -317,16 +336,22 @@ The following table lists parameters of linear and ridge regressions at the trai Step 1 - on Local Nodes +++++++++++++++++++++++ -.. image:: images/distributed-step-1.png +.. figure:: images/distributed-step-1.png :width: 600 + :alt: + + Linear and Ridge Regression Training: Distributed Processing, Step 1 - on Local Nodes In this step, linear and ridge regression training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Linear and Ridge Regression (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -341,7 +366,9 @@ In this step, linear and ridge regression training calculates the result describ Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Linear and Ridge Regression (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -349,7 +376,7 @@ For more details, see :ref:`algorithms`. - Result * - ``partialModel`` - Pointer to the partial linear regression model that corresponds to the :math:`i`-th data block. - + The result can only be an object of the ``Model`` class. .. _lin_ridge_step_2: @@ -357,14 +384,19 @@ For more details, see :ref:`algorithms`. Step 2 - on Master Node +++++++++++++++++++++++ -.. image:: images/distributed-step-2.png +.. figure:: images/distributed-step-2.png :width: 600 + :alt: + + Linear and Ridge Regression Training: Distributed Processing, Step 2 - on Master Node In this step, linear and ridge regression training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Linear and Ridge Regression (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -372,14 +404,16 @@ For more details, see :ref:`algorithms`. - Input * - ``partialModels`` - A collection of partial models computed on local nodes in :ref:`Step 1 `. - + The collection contains objects of the ``Model`` class. In this step, linear and ridge regression training calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Linear and Ridge Regression (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -387,7 +421,7 @@ For more details, see :ref:`algorithms`. - Result * - ``model`` - Pointer to the linear or ridge regression model being trained. - + The result can only be an object of the ``Model`` class. Examples @@ -419,7 +453,7 @@ Examples .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -446,7 +480,7 @@ Examples - :daal4py_sycl_example:`linear_regression_batch.py` - .. tab:: Python* + .. tab:: Python* Batch Processing: diff --git a/docs/source/daal/algorithms/linear_ridge_regression/ridge-regression.rst b/docs/source/daal/algorithms/linear_ridge_regression/ridge-regression.rst index ac99b0bda67..76666ad9224 100644 --- a/docs/source/daal/algorithms/linear_ridge_regression/ridge-regression.rst +++ b/docs/source/daal/algorithms/linear_ridge_regression/ridge-regression.rst @@ -39,9 +39,9 @@ Let |x_vector| be a vector of input variables and :math:`y = (y_1, \ldots, y_k)` be the response. For each :math:`j=1, \ldots, k`, the ridge regression model has the form similar to the linear regression model [Hoerl70]_, except that the coefficients are estimated by minimizing a -different objective function [James2013]_: +different objective function [James2013]_: -.. math:: +.. math:: y_j = \beta_{0j} + \beta_{1j}x_1 + \ldots + \beta_{pj}x_p Here :math:`x_i`, :math:`i=1, \ldots, p`, are referred to as independent @@ -51,7 +51,7 @@ or responses. Training Stage ---------------- -Let :math:`(x_{11}, \ldots, x_{1p}, y_{11}, \ldots, y_{1k}), \ldots, (x_{n1}, \ldots, x_{np}, y_{n1}, \ldots, y_{nk})` +Let :math:`(x_{11}, \ldots, x_{1p}, y_{11}, \ldots, y_{1k}), \ldots, (x_{n1}, \ldots, x_{np}, y_{n1}, \ldots, y_{nk})` be a set of training data, :math:`n \gg p`. The matrix :math:`X` of size :math:`n \times p` contains observations :math:`x_ij`, :math:`i=1, \ldots, n`, :math:`j=1, \ldots, p`, of independent variables. @@ -69,5 +69,5 @@ where :math:`λ_j \geq 0` are ridge parameters [Hoerl70]_, [James2013]_. Prediction Stage ---------------- -Ridge regression based prediction is done for input vector |x_vector| using the +Ridge regression based prediction is done for input vector |x_vector| using the equation :math:`y_j = \beta_{0j} + \beta_{1j}x_1 + \ldots + \beta_{pj}x_p` for each :math:`j=1, \ldots, k`. diff --git a/docs/source/daal/algorithms/logistic_regression/logistic-regression.rst b/docs/source/daal/algorithms/logistic_regression/logistic-regression.rst index 60a62dda2db..7006a8f55a8 100644 --- a/docs/source/daal/algorithms/logistic_regression/logistic-regression.rst +++ b/docs/source/daal/algorithms/logistic_regression/logistic-regression.rst @@ -42,8 +42,8 @@ train a logistic regression model. The logistic regression model is the set of vectors :math:`\beta =\left\{ {\beta }_{0}=\left({\beta }_{00}\dots {\beta }_{0p}\right), {..\beta }_{K-1}=\left({\beta }_{K-10}\dots {\beta }_{K-1p}\right)\right\}` that gives the posterior probability - .. math:: - {P\left\{y=k|x\right\}= p}_{k}\left(x, \beta \right)=\mathrm{ }\frac{{e}^{{f}_{k}\left(x, \beta \right)}}{\sum _{i=0}^{K-1}{e}^{{f}_{i}\left(x, \beta \right)}}, \text{where} {f}_{k}\left(x, \beta \right)= {\beta }_{k0}+ \sum _{j=1}^{p}{\beta }_{kj}*{x}_{j} +.. math:: + {P\left\{y=k|x\right\}= p}_{k}\left(x, \beta \right)=\mathrm{ }\frac{{e}^{{f}_{k}\left(x, \beta \right)}}{\sum _{i=0}^{K-1}{e}^{{f}_{i}\left(x, \beta \right)}}, \text{where} {f}_{k}\left(x, \beta \right)= {\beta }_{k0}+ \sum _{j=1}^{p}{\beta }_{kj}*{x}_{j} for a given feature vector :math:`x = (x_1, \ldots, x_p)` and class label :math:`y \in \{0, 1, \ldots, K - 1\}` for each :math:`k = 0, \ldots, K-1`. See [Hastie2009]_. @@ -95,8 +95,8 @@ complete the following steps: - Use the ``setBeta`` method to add the set of pre-calculated coefficients to the model. Specify random access iterators to the first and the last element of the set of coefficients [ISO/IEC 14882:2011 §24.2.7]_. - .. note:: - + .. note:: + If your set of coefficients does not contain an intercept, interceptFlag is automatically set to ``False``, and to ``True``, otherwise. - Use the ``getModel`` method to get the trained Logistic Regression model. @@ -105,7 +105,7 @@ complete the following steps: that describe the problems API encountered (in case of API runtime failure). .. note:: - + If after calling the ``getModel`` method you use the ``setBeta`` method to update coefficients, the initial model will be automatically updated with the new :math:`\beta` coefficients. @@ -119,7 +119,7 @@ Examples - :cpp_example:`log_reg_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`LogRegModelBuilder.java ` @@ -142,10 +142,13 @@ For a description of the input and output, refer to :ref:`classification_usage_m In addition to the parameters of classifier described in :ref:`classification_usage_model`, the logistic regression batch training algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Logistic Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -188,10 +191,13 @@ For a description of the input, refer to :ref:`classification_usage_model`. At the prediction stage logistic regression batch algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Prediction Parameters for Logistic Regression (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -225,10 +231,13 @@ Output In addition to classifier output, logistic regression prediction calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Output for Logistic Regression (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result @@ -268,7 +277,7 @@ Examples - :cpp_example:`log_reg_binary_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -288,4 +297,4 @@ Examples Batch Processing: - :daal4py_example:`log_reg_dense_batch.py` - - :daal4py_example:`log_reg_binary_dense_batch.py` + - :daal4py_example:`log_reg_binary_dense_batch.py` diff --git a/docs/source/daal/algorithms/moments/computation-batch.rst b/docs/source/daal/algorithms/moments/computation-batch.rst index d2651478c40..74241294ecf 100644 --- a/docs/source/daal/algorithms/moments/computation-batch.rst +++ b/docs/source/daal/algorithms/moments/computation-batch.rst @@ -19,10 +19,6 @@ Batch Processing ================ -- `Algorithm Input`_ -- `Algorithm Parameters`_ -- `Algorithm Output`_ - Algorithm Input *************** @@ -30,7 +26,9 @@ The low order moments algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Low Order Moments (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -48,9 +46,12 @@ Algorithm Parameters The low order moments algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Low Order Moments (Batch Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -87,9 +88,9 @@ The low order moments algorithm has the following parameters: - ``estimatesAll`` - Estimates to be computed by the algorithm: - - ``estimatesAll`` - all supported moments - - ``estimatesMinMax`` - minimum and maximum - - ``estimatesMeanVariance`` - mean and variance + - ``estimatesAll`` - all supported moments + - ``estimatesMinMax`` - minimum and maximum + - ``estimatesMeanVariance`` - mean and variance Algorithm Output **************** @@ -104,9 +105,12 @@ For more details, see :ref:`algorithms`. By default, the tables are objects of the ``HomogenNumericTable`` class, but you can define each table as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Low Order Moments (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Characteristic diff --git a/docs/source/daal/algorithms/moments/computation-distributed.rst b/docs/source/daal/algorithms/moments/computation-distributed.rst index 682bb45a90f..719fde54ab2 100644 --- a/docs/source/daal/algorithms/moments/computation-distributed.rst +++ b/docs/source/daal/algorithms/moments/computation-distributed.rst @@ -24,9 +24,12 @@ Algorithm Parameters The low order moments algorithm in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Low Order Moments (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -45,26 +48,26 @@ The low order moments algorithm in the distributed processing mode has the follo - ``defaultDense`` - Available methods for computation of low order moments: - defaultDense - default performance-oriented method + defaultDense + default performance-oriented method - singlePassDense - implementation of the single-pass algorithm proposed by D.H.D. West + singlePassDense + implementation of the single-pass algorithm proposed by D.H.D. West - sumDense - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined + sumDense + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined - fastCSR - performance-oriented method for CSR numeric tables + fastCSR + performance-oriented method for CSR numeric tables - singlePassCSR - implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables + singlePassCSR + implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables - sumCSR - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; optimized for CSR numeric tables; - returns an error if pre-computed sums are not defined + sumCSR + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; optimized for CSR numeric tables; + returns an error if pre-computed sums are not defined * - ``estimatesToCompute`` - ``estimatesAll`` @@ -85,15 +88,17 @@ In this step, the low order moments algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Low Order Moments (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n_i \times p` that represents the :math:`i`-th data block on the local node. - + - Pointer to the numeric table of size :math:`n_i \times p` that represents the :math:`i`-th data block on the local node. + While the input for ``defaultDense``, ``singlePassDense``, or ``sumDense`` method can be an object of any class derived from ``NumericTable``, the input for ``fastCSR``, ``singlePassCSR``, or ``sumCSR`` method can only be an object of the ``CSRNumericTable`` class. @@ -102,15 +107,17 @@ In this step, the low order moments algorithm calculates the results described b Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Low Order Moments (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``nObservations`` - - Pointer to the :math:`1 \times 1` numeric table that contains the number of observations processed so far on the local node. - + - Pointer to the :math:`1 \times 1` numeric table that contains the number of observations processed so far on the local node. + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. @@ -118,9 +125,12 @@ Partial characteristics computed so far on the local node, each in a :math:`1 \t By default, each table is an object of the ``HomogenNumericTable`` class, but you can define the tables as objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Characteristics for Low Order Moments (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result @@ -144,7 +154,9 @@ In this step, the low order moments algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Low Order Moments (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -165,9 +177,12 @@ For more details, see :ref:`algorithms`. but you can define each table as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Low Order Moments (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Characteristic diff --git a/docs/source/daal/algorithms/moments/computation-online.rst b/docs/source/daal/algorithms/moments/computation-online.rst index 57c91ce7260..a331a1c146f 100644 --- a/docs/source/daal/algorithms/moments/computation-online.rst +++ b/docs/source/daal/algorithms/moments/computation-online.rst @@ -29,15 +29,17 @@ The low order moments algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Low Order Moments (Online Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n_i \times p` that represents the current data block. - + - Pointer to the numeric table of size :math:`n_i \times p` that represents the current data block. + While the input for ``defaultDense``, ``singlePassDense``, or ``sumDense`` method can be an object of any class derived from ``NumericTable``, the input for ``fastCSR``, ``singlePassCSR``, or ``sumCSR`` method can only be an object of the ``CSRNumericTable`` class. @@ -47,9 +49,12 @@ Algorithm Parameters The low order moments algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Low Order Moments (Online Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -61,31 +66,31 @@ The low order moments algorithm has the following parameters: - ``defaultDense`` - Available methods for computation of low order moments: - defaultDense - default performance-oriented method + defaultDense + default performance-oriented method - singlePassDense - implementation of the single-pass algorithm proposed by D.H.D. West + singlePassDense + implementation of the single-pass algorithm proposed by D.H.D. West - sumDense - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined + sumDense + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; returns an error if pre-computed sums are not defined - fastCSR - performance-oriented method for CSR numeric tables + fastCSR + performance-oriented method for CSR numeric tables - singlePassCSR - implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables + singlePassCSR + implementation of the single-pass algorithm proposed by D.H.D. West; optimized for CSR numeric tables - sumCSR - implementation of the algorithm in the cases where the basic statistics associated with - the numeric table are pre-computed sums; optimized for CSR numeric tables; - returns an error if pre-computed sums are not defined + sumCSR + implementation of the algorithm in the cases where the basic statistics associated with + the numeric table are pre-computed sums; optimized for CSR numeric tables; + returns an error if pre-computed sums are not defined * - ``initializationProcedure`` - Not applicable - The procedure for setting initial parameters of the algorithm in the online processing mode. - + By default, the algorithm does the following initialization: - Sets ``nObservations``, ``partialSum``, and ``partialSumSquares`` to zero. @@ -106,25 +111,30 @@ The low order moments algorithm in the online processing mode calculates partial Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for Low Order Moments (Online Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``nObservations`` - - Pointer to the :math:`1 \times 1` numeric table that contains the number of rows processed so far. - + - Pointer to the :math:`1 \times 1` numeric table that contains the number of rows processed so far. + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. -Partial characteristics computed so far, each in a :math:`1 \times p` numeric table. +Partial characteristics computed so far, each in a :math:`1 \times p` numeric table. By default, each table is an object of the ``HomogenNumericTable`` class, but you can define the tables as objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Characteristics for Low Order Moments (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result @@ -153,9 +163,12 @@ For more details, see :ref:`algorithms`. but you can define each table as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Low Order Moments (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Characteristic diff --git a/docs/source/daal/algorithms/moments/moments-of-low-order.rst b/docs/source/daal/algorithms/moments/moments-of-low-order.rst index bc4bea929c6..1b303d34620 100644 --- a/docs/source/daal/algorithms/moments/moments-of-low-order.rst +++ b/docs/source/daal/algorithms/moments/moments-of-low-order.rst @@ -20,7 +20,7 @@ Moments of Low Order ==================== Moments are basic quantitative measures of data set characteristics such as location and dispersion. -|short_name| computes the following low order characteristics: +|short_name| computes the following low order characteristics: - minimums/maximums - sums @@ -35,14 +35,17 @@ Moments are basic quantitative measures of data set characteristics such as loca Details ******* -Given a set :math:`X` of :math:`n` feature vectors -:math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, +Given a set :math:`X` of :math:`n` feature vectors +:math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, the problem is to compute the following sample characteristics for each feature in the data set: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Moments of Low Order :widths: 20 60 :header-rows: 1 :align: left + :class: longtable * - Statistic - Definition @@ -74,7 +77,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-online.rst computation-distributed.rst @@ -102,7 +105,7 @@ Examples - :cpp_example:`low_order_moms_csr_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/naive_bayes/computation-batch.rst b/docs/source/daal/algorithms/naive_bayes/computation-batch.rst index e42a9bfe620..e69a6ffff84 100644 --- a/docs/source/daal/algorithms/naive_bayes/computation-batch.rst +++ b/docs/source/daal/algorithms/naive_bayes/computation-batch.rst @@ -25,10 +25,13 @@ Training At the training stage, Naïve Bayes classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Naïve Bayes Classifier (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -40,8 +43,8 @@ At the training stage, Naïve Bayes classifier has the following parameters: - ``defaultDense`` - Available computation methods for the Naïve Bayes classifier: - - ``defaultDense`` - default performance-oriented method - - ``fastCSR`` - performance-oriented method for CSR numeric tables + - ``defaultDense`` - default performance-oriented method + - ``fastCSR`` - performance-oriented method for CSR numeric tables * - ``nClasses`` - Not applicable @@ -59,10 +62,13 @@ Prediction At the prediction stage, Naïve Bayes classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for Naïve Bayes Classifier (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/naive_bayes/computation-distributed.rst b/docs/source/daal/algorithms/naive_bayes/computation-distributed.rst index bcbcca383ca..073827ff491 100644 --- a/docs/source/daal/algorithms/naive_bayes/computation-distributed.rst +++ b/docs/source/daal/algorithms/naive_bayes/computation-distributed.rst @@ -29,9 +29,12 @@ Algorithm Parameters At the training stage, Naïve Bayes classifier in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Naïve Bayes Classifier (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -50,8 +53,8 @@ At the training stage, Naïve Bayes classifier in the distributed processing mod - ``defaultDense`` - Available computation methods for the Naïve Bayes classifier: - - ``defaultDense`` - default performance-oriented method - - ``fastCSR`` - performance-oriented method for CSR numeric tables + - ``defaultDense`` - default performance-oriented method + - ``fastCSR`` - performance-oriented method for CSR numeric tables * - ``nClasses`` - Not applicable @@ -70,16 +73,22 @@ Use the two-step computation schema for Naïve Bayes classifier training in the Step 1 - on Local Nodes ----------------------- -.. image:: images/naive-bayes-distributed-step-1.png +.. figure:: images/naive-bayes-distributed-step-1.png :width: 600 + :alt: + + Training with Naïve Bayes Classifier: Distributed Processing, Step 1 - on Local Nodes In this step, Naïve Bayes classifier training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Naïve Bayes Classifier (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -94,7 +103,9 @@ In this step, Naïve Bayes classifier training calculates the result described b Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Naïve Bayes Classifier (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -102,7 +113,7 @@ For more details, see :ref:`algorithms`. - Result * - ``partialModel`` - Pointer to the partial Naïve Bayes classifier model that corresponds to the :math:`i`-th data block. - + The result can only be an object of the ``Model`` class. .. _naive_bayes_step_2: @@ -110,14 +121,19 @@ For more details, see :ref:`algorithms`. Step 2 - on Master Node ------------------------ -.. image:: images/naive-bayes-distributed-step-2.png +.. figure:: images/naive-bayes-distributed-step-2.png :width: 600 + :alt: + + Trainin with Naïve Bayes Classifier: Distributed Processing, Step 2 - on Master Node In this step, Naïve Bayes classifier training accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Naïve Bayes Classifier (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -125,20 +141,22 @@ For more details, see :ref:`algorithms`. - Input * - ``partialModels`` - A collection of partial models computed on local nodes in :ref:`Step 1 `. - + The collection contains objects of the ``Model`` class. In this step, Naïve Bayes classifier training calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Naïve Bayes Classifier (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``model`` - - Pointer to the Naïve Bayes classifier model being trained. - + - Pointer to the Naïve Bayes classifier model being trained. + The result can only be an object of the ``Model`` class. diff --git a/docs/source/daal/algorithms/naive_bayes/computation-online.rst b/docs/source/daal/algorithms/naive_bayes/computation-online.rst index 07f02dc7a99..9347c10245a 100644 --- a/docs/source/daal/algorithms/naive_bayes/computation-online.rst +++ b/docs/source/daal/algorithms/naive_bayes/computation-online.rst @@ -30,9 +30,12 @@ Naïve Bayes classifier in the online processing mode accepts the input describe Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Naïve Bayes Classifier (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -45,10 +48,13 @@ For more details, see :ref:`algorithms`. Naïve Bayes classifier in the online processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Training Parameters for Naïve Bayes Classifier (Online Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -60,8 +66,8 @@ Naïve Bayes classifier in the online processing mode has the following paramete - ``defaultDense`` - Available computation methods for the Naïve Bayes classifier: - - ``defaultDense`` - default performance-oriented method - - ``fastCSR`` - performance-oriented method for CSR numeric tables + - ``defaultDense`` - default performance-oriented method + - ``fastCSR`` - performance-oriented method for CSR numeric tables * - ``nClasses`` - Not applicable diff --git a/docs/source/daal/algorithms/naive_bayes/naive-bayes-classifier.rst b/docs/source/daal/algorithms/naive_bayes/naive-bayes-classifier.rst index 570a724528d..feb117ad574 100644 --- a/docs/source/daal/algorithms/naive_bayes/naive-bayes-classifier.rst +++ b/docs/source/daal/algorithms/naive_bayes/naive-bayes-classifier.rst @@ -50,9 +50,9 @@ Training Stage The Training stage involves calculation of these parameters: -- :math:`\mathrm{log}\left({\theta }_{jk}\right)=\mathrm{log}\left(\frac{{N}_{jk}+{\alpha }_{k}}{{N}_{j}+\alpha }\right)`, where - :math:`N_{jk}` is the number of occurrences of the feature :math:`k` in the class :math:`j`, - :math:`N_j` is the total number of occurrences of all features in the class, +- :math:`\mathrm{log}\left({\theta }_{jk}\right)=\mathrm{log}\left(\frac{{N}_{jk}+{\alpha }_{k}}{{N}_{j}+\alpha }\right)`, where + :math:`N_{jk}` is the number of occurrences of the feature :math:`k` in the class :math:`j`, + :math:`N_j` is the total number of occurrences of all features in the class, the :math:`\alpha_k`the parameter is the imagined number of occurrences of the feature :math:`k` (for example, :math:`\alpha_k = 1`), and :math:`\alpha` is the sum of all :math:`\alpha_k`. @@ -73,7 +73,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-online.rst computation-distributed.rst @@ -90,7 +90,7 @@ Examples - :cpp_example:`mn_naive_bayes_dense_batch.cpp ` - :cpp_example:`mn_naive_bayes_csr_batch.cpp ` - Online Processing: + Online Processing: - :cpp_example:`mn_naive_bayes_dense_online.cpp ` - :cpp_example:`mn_naive_bayes_csr_online.cpp ` @@ -101,14 +101,14 @@ Examples - :cpp_example:`mn_naive_bayes_csr_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`MnNaiveBayesDenseBatch.java ` - :java_example:`MnNaiveBayesCSRBatch.java ` - + Online Processing: - :java_example:`MnNaiveBayesDenseOnline.java ` @@ -143,14 +143,14 @@ Training Stage To get the best overall performance at the Naïve Bayes classifier training stage: -- If input data is homogeneous: +- If input data is homogeneous: - - For the training data set, use a homogeneous numeric table - of the same type as specified in the algorithmFPType class - template parameter. - - For class labels, use a homogeneous numeric table of type int. + - For the training data set, use a homogeneous numeric table + of the same type as specified in the algorithmFPType class + template parameter. + - For class labels, use a homogeneous numeric table of type int. -- If input data is non-homogeneous, use AOS layout rather than SOA layout. +- If input data is non-homogeneous, use AOS layout rather than SOA layout. The training stage of the Naïve Bayes classifier algorithm is memory access bound in most cases. Therefore, use efficient data diff --git a/docs/source/daal/algorithms/normalization/index.rst b/docs/source/daal/algorithms/normalization/index.rst index bd881ba986c..de42984cc04 100644 --- a/docs/source/daal/algorithms/normalization/index.rst +++ b/docs/source/daal/algorithms/normalization/index.rst @@ -20,7 +20,7 @@ Normalization Normalization is a set of algorithms intended to transform data before feeding it to some classes of algorithms, for example, classifiers [James2013]_. Normalization may improve computation accuracy and efficiency. -Different rules can be used to normalize data. +Different rules can be used to normalize data. In |short_name|, two techniques to normalize data are implemented: z-score and min-max. .. toctree:: diff --git a/docs/source/daal/algorithms/normalization/min-max.rst b/docs/source/daal/algorithms/normalization/min-max.rst index e5dccbf7c72..0d797731c41 100644 --- a/docs/source/daal/algorithms/normalization/min-max.rst +++ b/docs/source/daal/algorithms/normalization/min-max.rst @@ -22,9 +22,9 @@ Min-max normalization is an algorithm to linearly scale the observations by each Problem Statement ***************** -Given a set :math:`X` of :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` +Given a set :math:`X` of :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, the problem is to compute the matrix :math:`Y = (y_{ij})_{n \times p}` where the :math:`j`-th column -:math:`(Y)_j = (y_{ij})_{i = 1, \ldots, n}` is obtained as a result of normalizing the column +:math:`(Y)_j = (y_{ij})_{i = 1, \ldots, n}` is obtained as a result of normalizing the column :math:`(X)_j = (x_{ij})_{i = 1, \ldots, n}` of the original matrix as: .. math:: @@ -35,7 +35,7 @@ where: .. math:: \min(j) = \min _{i = 1, \ldots, n} x_{ij}, - + .. math:: \max(j) = \max _{i = 1, \ldots, n} x_{ij}, @@ -48,18 +48,20 @@ Algorithm Input --------------- The min-max normalization algorithm accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Min-max (Batch Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n \times p`. - + - Pointer to the numeric table of size :math:`n \times p`. + .. note:: This table can be an object of any class derived from ``NumericTable``. Algorithm Parameters @@ -67,10 +69,13 @@ Algorithm Parameters The min-max normalization algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Min-max (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -100,7 +105,9 @@ The min-max normalization algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see ``Algorithms``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Min-max (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -108,10 +115,10 @@ For more details, see ``Algorithms``. - Result * - ``normalizedData`` - Pointer to the :math:`n \times p` numeric table that stores the result of normalization. - + .. note:: - - By default, the result is an object of the ``HomogenNumericTable`` class, + + By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -127,7 +134,7 @@ Examples - :cpp_example:`minmax_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/normalization/z-score.rst b/docs/source/daal/algorithms/normalization/z-score.rst index 2624d54df54..23d1a7a6656 100644 --- a/docs/source/daal/algorithms/normalization/z-score.rst +++ b/docs/source/daal/algorithms/normalization/z-score.rst @@ -22,7 +22,7 @@ Z-score normalization is an algorithm that produces data with each feature (colu Details ******* -Given a set :math:`X` of :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` +Given a set :math:`X` of :math:`n` feature vectors :math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, the problem is to compute the matrix :math:`Y = (y_{ij})` of dimension :math:`n \times p` as following: .. math:: @@ -42,15 +42,15 @@ The mode may include: After normalization, the mean of :math:`j`-th component of result set :math:`(Y)_j` will be zero. - **Centering and scaling.** In this case, :math:`\Delta = \sigma_j`, where :math:`\sigma_j` - is the standard deviation of :math:`j`-th component of set :math:`(X)_j`. + is the standard deviation of :math:`j`-th component of set :math:`(X)_j`. After normalization, the mean of :math:`j`-th component of result set :math:`(Y)_j` will be zero and its variance will get a value of one. .. note:: - Some algorithms require normalization parameters (mean and variance) as an input. - The implementation of Z-score algorithm in |short_name| does not return these values by default. - Enable this option by setting the resultsToCompute flag. + Some algorithms require normalization parameters (mean and variance) as an input. + The implementation of Z-score algorithm in |short_name| does not return these values by default. + Enable this option by setting the resultsToCompute flag. For details, see `Algorithm Parameters`_. Batch Processing @@ -59,31 +59,36 @@ Batch Processing Algorithm Input --------------- -Z-score normalization algorithm accepts an input as described below. +Z-score normalization algorithm accepts an input as described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Z-score (Batch Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the numeric table of size :math:`n \times p`. - + - Pointer to the numeric table of size :math:`n \times p`. + .. note:: This table can be an object of any class derived from ``NumericTable``. Algorithm Parameters -------------------- -Z-score normalization algorithm has the following parameters. +Z-score normalization algorithm has the following parameters. Some of them are required only for specific values of the computation method parameter ``method``: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for Z-score (Batch Processing) :header-rows: 1 - :widths: 10 10 10 60 + :widths: 10 10 10 60 :align: left + :class: longtable * - Parameter - method @@ -118,7 +123,7 @@ Some of them are required only for specific values of the computation method par - ``defaultDense`` or ``sumDense`` - Not applicable - *Optional*. - + Pointer to the data collection containing the following key-value pairs for Z-score: - ``mean`` - means @@ -129,34 +134,37 @@ Some of them are required only for specific values of the computation method par Algorithm Output ---------------- -Z-score normalization algorithm calculates the result as described below. +Z-score normalization algorithm calculates the result as described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Z-score (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``normalizedData`` - Pointer to the :math:`n \times p` numeric table that stores the result of normalization. - + .. note:: - - By default, the result is an object of the ``HomogenNumericTable`` class, + + By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. * - ``means`` - *Optional*. - + Pointer to the :math:`1 \times p` numeric table that contains mean values for each feature. If the function result is not requested through the ``resultsToCompute`` parameter, the numeric table contains a ``NULL`` pointer. * - ``variances`` - *Optional*. - + Pointer to the :math:`1 \times p` numeric table that contains variance values for each feature. If the function result is not requested through the ``resultsToCompute`` parameter, @@ -180,7 +188,7 @@ Examples - :cpp_example:`zscore_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-function.rst b/docs/source/daal/algorithms/optimization-solvers/objective-function.rst index 6d8efd2e46e..6c17e6ee2ee 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-function.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-function.rst @@ -34,11 +34,11 @@ where :math:`F(\theta)` is a smooth and :math:`M(\theta)` is a non-smooth functi - The Hessian of :math:`F(\theta)`: .. math:: - H = = \nabla^2 F(\theta) = + H = = \nabla^2 F(\theta) = {\nabla }^{2}{F}_{i}=\left[\begin{array}{ccc}\frac{\partial {F}_{i}} {\partial {\theta }_{1}\partial {\theta }_{1}}& \cdots & \frac{\partial {F}_{i}} - {\partial {\theta }_{1}\partial {\theta }_{p}}\\ ⋮& \ddots & ⋮\\ - \frac{\partial {F}_{i}}{\partial p\partial {\theta }_{1}}& \cdots & + {\partial {\theta }_{1}\partial {\theta }_{p}}\\ ⋮& \ddots & ⋮\\ + \frac{\partial {F}_{i}}{\partial p\partial {\theta }_{1}}& \cdots & \frac{\partial {F}_{i}}{\partial {\theta }_{p}\partial {\theta }_{p}}\end{array}\right] - The objective function specific projection of proximal operator (see [MSE, Log-Loss, Cross-Entropy] for details): @@ -61,5 +61,5 @@ where :math:`F(\theta)` is a smooth and :math:`M(\theta)` is a non-smooth functi objective-functions/with-precomputed-characteristics.rst objective-functions/logistic-loss.rst objective-functions/cross-entropy.rst - + .. note:: On GPU, only :ref:`logistic_loss` and :ref:`cross_entropy_loss` are supported, :ref:`mse` is not supported. \ No newline at end of file diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/computation.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/computation.rst index 81d40b0f6bf..0f2f3febbee 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/computation.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/computation.rst @@ -24,7 +24,9 @@ The objective function accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Objective Function Computaion :widths: 10 60 :align: left @@ -38,9 +40,12 @@ Parameters The objective function has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Parameters for Objective Function Computaion :widths: 15 15 70 :align: left + :class: longtable * - Parameter - Default value @@ -78,26 +83,29 @@ The objective function has the following parameters: Output ****** -The objective function calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The objective function calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Objective Function Computaion :widths: 10 60 :align: left + :class: longtable * - Result ID - Result * - ``valueIdx`` - A numeric table of size :math:`1 \times 1` with the value of the objective function in the given argument. * - ``nonSmoothTermValueIdx`` - - A numeric table of size :math:`1 \times 1` with the value of the non-smooth term of the + - A numeric table of size :math:`1 \times 1` with the value of the non-smooth term of the objective function in the given argument. * - ``gradientIdx`` - - A numeric table of size :math:`p \times 1` with the gradient of the smooth term of the + - A numeric table of size :math:`p \times 1` with the gradient of the smooth term of the objective function in the given argument. * - ``hessianIdx`` - - A numeric table of size :math:`p \times p` with the Hessian of the smooth term of the + - A numeric table of size :math:`p \times p` with the Hessian of the smooth term of the objective function in the given argument. * - ``proximalProjectionIdx`` - A numeric table of size :math:`p \times 1` with the projection of proximal operator @@ -113,16 +121,16 @@ For more details, see :ref:`algorithms`. .. note:: - - If the function result is not requested through the resultsToCompute parameter, + - If the function result is not requested through the resultsToCompute parameter, the respective element of the result contains a NULL pointer. - - By default, each numeric table specified by the collection elements is an object of the HomogenNumericTable class, + - By default, each numeric table specified by the collection elements is an object of the HomogenNumericTable class, but you can define the result as an object of any class derived from NumericTable, except for PackedSymmetricMatrix, PackedTriangularMatrix, and CSRNumericTable. - - Hessian matrix is computed for the objective function :math:`F(\theta) \in C^2`. + - Hessian matrix is computed for the objective function :math:`F(\theta) \in C^2`. For the objective functions :math:`F(\theta) \in C^p` with :math`p < 2` the library will stop computations and report the status on non-availability of the computation of the Hessian. - - If Lipschitz constant constantOfLipschitz is not estimated explicitly, + - If Lipschitz constant constantOfLipschitz is not estimated explicitly, pointer to result numeric table is required to be set to nullptr. diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/cross-entropy.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/cross-entropy.rst index 01fd4c16dc1..a12cc2d409a 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/cross-entropy.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/cross-entropy.rst @@ -21,10 +21,6 @@ Cross-entropy Loss Cross-entropy loss is an objective function minimized in the process of logistic regression training when a dependent variable takes more than two values. -.. contents:: - :local: - :depth: 1 - Details ******* @@ -48,10 +44,10 @@ the value and the gradient of the sum of functions in the argument X respectivel (\log p_{y_i} (x_i, \theta) + \lambda_2 \sum_{t=0}^{T-1} \sum_{j=1}^{p} \theta_{ij}^2) .. math:: - \nabla F_I(\theta, x, y) = + \nabla F_I(\theta, x, y) = \left( \frac{\partial F_I}{\partial \theta_{00}}, \ldots, \frac{\partial F_I}{\partial \theta_{{T-1}p}} \right)^T -where +where .. math:: \frac{\partial F_I}{\partial \theta_{tj}} = @@ -60,7 +56,7 @@ where \frac{1}{m} \sum_{i \in I} g_t (\theta, x_i, y_i) x_{ij} + L_{tj}(\theta), & j = 0 \end{cases} - g_t (\theta, x, y) = + g_t (\theta, x, y) = \begin{cases} p_k (x, \theta) - 1, & y = t \\ p_t (x, \theta), & y \neq t @@ -83,18 +79,18 @@ Hessian matrix is a symmetric matrix of size :math:`S \times S`, where :math:`S \frac {\partial^2 F_I} {\partial \theta_{00} \partial \theta_{{T-1} p}} \\ - \vdots & \ddots & \vdots \\ + \vdots & \ddots & \vdots \\ \frac {\partial^2 F_I} {\partial \theta_{{T-1} p} \partial \theta_{00}} & - \cdots & + \cdots & \frac {\partial^2 F_I} {\partial \theta_{{T-1} p} \partial \theta_{{T-1} p}} \end{array}\right] .. math:: - \frac {\partial^2 F_I} {\partial \theta_{tj} \partial \theta_{pq}} = + \frac {\partial^2 F_I} {\partial \theta_{tj} \partial \theta_{pq}} = \begin{cases} \frac{1}{m} \sum_{i \in I} g_{tp} (\theta, x_i, y_i) + 2 \lambda_2, & j = 0, q = 0\\ @@ -113,7 +109,7 @@ Hessian matrix is a symmetric matrix of size :math:`S \times S`, where :math:`S p_p (x, \theta) (1 - p_t (x, \theta)), & p = t \\ -p_t (x, \theta) p_p (x, \theta), & p \neq t \end{cases} - + t, p \in [0, T-1] j, q \in [0, p] @@ -131,10 +127,6 @@ For more details, see [Hastie2009]_. Computation *********** -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- @@ -142,27 +134,30 @@ The cross entropy loss algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Cross-entropy Loss Computaion :widths: 10 60 :align: left + :class: longtable * - Input ID - Input * - ``argument`` - A numeric table of size :math:`(p + 1) \times \mathrm{nClasses}` with the input argument :math:`\theta` of the objective function. - .. note:: + .. note:: The sizes of the argument, gradient, and hessian numeric tables do not depend on ``interceptFlag``. When ``interceptFlag`` is set to ``false``, the computation of :math:`\theta_0` value is skipped, but the sizes of the tables should remain the same. * - ``data`` - A numeric table of size :math:`n \times p` with the data :math:`x_ij`. - + .. note:: This parameter can be an object of any class derived from ``NumericTable``. * - ``dependentVariables`` - A numeric table of size :math:`n \times 1` with dependent variables :math:`y_i`. - .. note:: + .. note:: This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix`` , ``PackedSymmetricMatrix`` , and ``CSRNumericTable``. @@ -173,9 +168,12 @@ Algorithm Parameters The cross entropy loss algorithm has the following parameters. Some of them are required only for specific values of the computation method's parameter ``method``: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Cross-entropy Loss Computaion :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default value @@ -246,7 +244,7 @@ Examples ******** .. tabs:: - + .. tab:: C++ (CPU) - :cpp_example:`lbfgs_cr_entr_loss_dense_batch.cpp ` diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/logistic-loss.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/logistic-loss.rst index 8bb219b0591..d073c082982 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/logistic-loss.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/logistic-loss.rst @@ -22,10 +22,6 @@ Logistic Loss Logistic loss is an objective function being minimized in the process of logistic regression training when a dependent variable takes only one of two values, :math:`0` and :math:`1`. -.. contents:: - :local: - :depth: 1 - Details ******* @@ -53,16 +49,16 @@ For a given set of the indices :math:`I = \{i_1, i_2, \ldots, i_m \}`, :math:`1 \leq i_r \leq n`, :math:`r \in \{1, \ldots, m \}`: - The value of the sum of functions has the format: - + .. math:: F_I(\theta, X, y) = -\frac{1}{m} \sum_{i \in I} \left( y_i \ln \sigma(x_i, \theta) + (1 - y_i) \ln (1 - \sigma(x_i, \theta)) \right) + \lambda_2 \sum_{k=1}^{p} \theta_k^2 - The gradient of the sum of functions has the format: - + .. math:: - \nabla F_I(\theta, x, y) = + \nabla F_I(\theta, x, y) = \left\{ \frac{\partial F_I}{\partial \theta_0}, \ldots, \frac{\partial F_I}{\partial \theta_p} \right\}, where @@ -87,10 +83,6 @@ For more details, see [Hastie2009]_. Computation *********** -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- @@ -98,27 +90,30 @@ The logistic loss algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Logitic Loss Computaion :widths: 10 60 :align: left + :class: longtable * - Input ID - Input * - ``argument`` - A numeric table of size :math:`(p + 1) \times 1` with the input argument :math:`\theta` of the objective function. - .. note:: + .. note:: The sizes of the argument, gradient, and hessian numeric tables do not depend on ``interceptFlag``. When ``interceptFlag`` is set to ``false``, the computation of :math:`\theta_0` value is skipped, but the sizes of the tables should remain the same. * - ``data`` - A numeric table of size :math:`n \times p` with the data :math:`x_ij`. - + .. note:: This parameter can be an object of any class derived from ``NumericTable``. * - ``dependentVariables`` - A numeric table of size :math:`n \times 1` with dependent variables :math:`y_i`. - .. note:: + .. note:: This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix`` , ``PackedSymmetricMatrix`` , and ``CSRNumericTable``. @@ -128,9 +123,12 @@ Algorithm Parameters The logistic loss algorithm has the following parameters. Some of them are required only for specific values of the computation method's parameter ``method``: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Logitic Loss Computaion :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default value diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/mse.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/mse.rst index 91e3a354332..e66846673f9 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/mse.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/mse.rst @@ -21,10 +21,6 @@ Mean Squared Error Algorithm .. note:: Mean Squared Error Algorithm is not supported on GPU. -.. contents:: - :local: - :depth: 1 - Details ******* @@ -56,7 +52,7 @@ the value and the gradient of the sum of functions in the argument :math:`x` res F_I(\theta; x, y) = \frac {1}{2m} \sum_{i_k \in I} (y_{i_k} - h(\theta, x_{i_k}))^2 .. math:: - \nabla F_I(\theta; x, y) = + \nabla F_I(\theta; x, y) = \left\{ \frac{\partial F_I}{\partial \theta_0}, \ldots, \frac{\partial F_I}{\partial \theta_p} \right\} where @@ -74,10 +70,6 @@ where Computation *********** -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- @@ -85,9 +77,12 @@ The mean squared error algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for MSE Computaion :widths: 10 60 :align: left + :class: longtable * - Input ID - Input @@ -105,9 +100,12 @@ The mean squared error algorithm accepts the optional input described below. Pass the Optional ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Optional Algorithm Input for MSE Computaion :widths: 10 60 :align: left + :class: longtable * - Input ID - Input @@ -116,14 +114,14 @@ For more details, see :ref:`algorithms`. Pointer to the :math:`1 \times n` numeric table with weights of samples. The input can be an object of any class derived from ``NumericTable`` except for ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. - + By default, all weights are equal to :math:`1`. * - ``gramMatrix`` - Optional input. Pointer to the :mathL`p \times p` numeric table with pre-computed Gram matrix. The input can be an object of any class derived from ``NumericTable`` except for ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. - + By default, the table is set to empty numeric table. Algorithm Parameters @@ -132,9 +130,12 @@ Algorithm Parameters The mean squared error algorithm has the following parameters. Some of them are required only for specific values of the computation method parameter method: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for MSE Computaion :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default value @@ -161,14 +162,14 @@ Some of them are required only for specific values of the computation method par - Not applicable - The numeric table of size :math:`1 \times m`, where :math:`m` is the batch size, with a batch of indices to be used to compute the function results. If no indices are provided, the implementation uses all the terms in the computation. - + .. note:: This parameter can be an object of any class derived from ``NumericTable`` except for ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. * - ``resultsToCompute`` - ``gradient`` - The 64-bit integer flag that specifies which characteristics of the objective function to compute. - + Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics: value @@ -199,7 +200,7 @@ Examples - :cpp_example:`mse_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`MSEDenseBatch.java ` diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/sum-of-functions.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/sum-of-functions.rst index 13f1a03398c..aa828f5d582 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/sum-of-functions.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/sum-of-functions.rst @@ -22,7 +22,7 @@ The sum of functions :math:`F(\theta)` is a function that has the form of a sum: .. math:: F(\theta) = \sum _{i=1}{n} F_i(\theta), \theta \in \mathbb{R}^p -For given set of the indices :math:`I = \{i_1, i_2, \ldots , i_m\}`, :math:`1 \leq ik < n`, +For given set of the indices :math:`I = \{i_1, i_2, \ldots , i_m\}`, :math:`1 \leq ik < n`, :math:`k \in \{1, \ldots, m\}`, the value and the gradient of the sum of functions in the argument :math:`\theta` has the format: .. math:: @@ -43,7 +43,9 @@ The sum of functions algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Sum of Functions Computaion :widths: 10 60 :header-rows: 1 @@ -57,10 +59,13 @@ Algorithm Parameters The sum of functions algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Sum of Functions Computaion :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value diff --git a/docs/source/daal/algorithms/optimization-solvers/objective-functions/with-precomputed-characteristics.rst b/docs/source/daal/algorithms/optimization-solvers/objective-functions/with-precomputed-characteristics.rst index 710d22a215c..9cd5f47072d 100644 --- a/docs/source/daal/algorithms/optimization-solvers/objective-functions/with-precomputed-characteristics.rst +++ b/docs/source/daal/algorithms/optimization-solvers/objective-functions/with-precomputed-characteristics.rst @@ -14,6 +14,8 @@ .. * limitations under the License. .. *******************************************************************************/ +.. _objective_function_precomputed_characteristics: + Objective Function with Precomputed Characteristics Algorithm ============================================================= @@ -21,7 +23,7 @@ Objective function with precomputed characteristics gives an ability to provide the results of the objective function precomputed with the user-defined algorithm. Set an earlier computed value and/or gradient and/or Hessian by allocating the result object -and setting the characteristics of this result object. +and setting the characteristics of this result object. After that provide the modified result object to the algorithm for its further use with the iterative solver. For more details on iterative solvers, refer to :ref:`iterative_solver`. diff --git a/docs/source/daal/algorithms/optimization-solvers/optimization-solvers.rst b/docs/source/daal/algorithms/optimization-solvers/optimization-solvers.rst index bc2eed83c92..187ad4b639f 100644 --- a/docs/source/daal/algorithms/optimization-solvers/optimization-solvers.rst +++ b/docs/source/daal/algorithms/optimization-solvers/optimization-solvers.rst @@ -17,7 +17,7 @@ Optimization Solvers ==================== -An optimization solver is an algorithm to solve an optimization problem, that is, +An optimization solver is an algorithm to solve an optimization problem, that is, to find the maximum or minimum of an objective function in the presence of constraints on its variables. In |short_name| the optimization solver represents the interface of algorithms that search for the argument :math:`\theta_{*}` that minimizes the function :math:`K(\theta)`: diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/adaptive-subgradient-method.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/adaptive-subgradient-method.rst index b77e1d7b586..93f47a54263 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/adaptive-subgradient-method.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/adaptive-subgradient-method.rst @@ -25,7 +25,7 @@ and algorithm-specific vector :math:`U` and power :math:`d` of `Lebesgue space < .. math:: S_t = {G_t} - + G_t = (G_{t, i})_{i = 1, \ldots, p} G_0 \equiv 0 @@ -36,8 +36,8 @@ and algorithm-specific vector :math:`U` and power :math:`d` of `Lebesgue space < where :math:`g_i(\theta_{t - 1})` is the :math:`i`-th coordinate of the gradient :math:`g(\theta_{t - 1})` #. :math:`\theta_t = \theta_{t - 1} - \frac {\eta}{\sqrt{G_t + \varepsilon}} g(\theta_{t - 1})`, - where - + where + .. math:: \frac {\eta}{\sqrt{G_t + \varepsilon}} g(\theta_{t - 1}) = \{\frac {\eta}{\sqrt{G_{t, 1} + \varepsilon}} g_1(\theta_{t - 1}), \ldots, \frac {\eta}{\sqrt{G_{t, 1} + \varepsilon}} g_p(\theta_{t - 1})\} @@ -56,7 +56,9 @@ Algorithm Input In addition to the :ref:`input of the iterative solver `, the AdaGrad method accepts the following optional input: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Adaptive Subgradient Method Computaion :header-rows: 1 :widths: 10 60 :align: left @@ -73,10 +75,13 @@ Algorithm Parameters In addition to :ref:`parameters of the iterative solver `, the AdaGrad method has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Adaptive Subgradient Method Computaion :header-rows: 1 :align: left :widths: 10 10 30 + :class: longtable * - Parameter - Default Value @@ -90,13 +95,13 @@ the AdaGrad method has the following parameters: * - ``batchIndices`` - ``NULL`` - A numeric table of size :math:`\text{nIterations} \times \text{batchSize}` for the ``defaultDense`` method - that represents 32-bit integer indices of terms in the objective function. + that represents 32-bit integer indices of terms in the objective function. If no indices are provided, the algorithm generates random indices. * - ``batchSize`` - :math:`128` - - The number of batch indices to compute the stochastic gradient. - - If ``batchSize`` equals the number of terms in the objective function, no random sampling is performed, + - The number of batch indices to compute the stochastic gradient. + + If ``batchSize`` equals the number of terms in the objective function, no random sampling is performed, and all terms are used to calculate the gradient. The algorithm ignores this parameter if the ``batchIndices`` parameter is provided. @@ -120,7 +125,9 @@ Algorithm Output In addition to the :ref:`output of the iterative solver `, the AdaGrad method calculates the following optional result: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Adaptive Subgradient Method Computaion :header-rows: 1 :widths: 10 60 :align: left @@ -142,7 +149,7 @@ Examples - :cpp_example:`adagrad_opt_res_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`AdagradDenseBatch.java ` diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/computation.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/computation.rst index 29f3f65adfa..5567fe783f2 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/computation.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/computation.rst @@ -28,17 +28,20 @@ The iterative solver algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see Algorithms. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Iterative Solver Computaion :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Input ID - Input * - ``inputArgument`` - A numeric table of size :math:`p \times 1` with the value of start argument :math:`\theta_0`. * - ``optionalArgument`` - - Object of the ``OptionalArgument`` class that contains a set of algorithm-specific intrinsic parameters. + - Object of the ``OptionalArgument`` class that contains a set of algorithm-specific intrinsic parameters. For a detailed definition of the set, see the problem statement above and the description of a specific algorithm. .. _iterative_solver_computation_parameters: @@ -48,10 +51,13 @@ Algorithm Parameters The iterative solver algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Iterative Solver Computaion :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -78,15 +84,18 @@ The iterative solver algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see Algorithms. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Iterative Solver Computaion :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result * - ``minimum`` - - A numeric table of size :math:`p \times 1` with argument :math:`\theta_{*}`. + - A numeric table of size :math:`p \times 1` with argument :math:`\theta_{*}`. By default, the result is an object of the HomogenNumericTable class, but you can define the result as an object of any class derived from NumericTable, except for PackedTriangularMatrix and PackedSymmetricMatrix. diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/coordinate-descent.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/coordinate-descent.rst index a3f51ef62e9..37d317c2754 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/coordinate-descent.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/coordinate-descent.rst @@ -55,7 +55,7 @@ and power :math:`d` of `Lebesgue space ` \begin{cases} (\theta_{t-1})_j - \lambda \frac{1}{\eta}, & (\theta_{t-1})_j > \lambda \frac{1}{\eta}\\ 0, & |(\theta_{t-1})_j| \leq \lambda \frac{1}{\eta}\\ - (\theta_{t-1})_j + \lambda \frac{1}{\eta}, & (\theta_{t-1})_j < -\lambda \frac{1}{\eta} + (\theta_{t-1})_j + \lambda \frac{1}{\eta}, & (\theta_{t-1})_j < -\lambda \frac{1}{\eta} \end{cases} Convergence check is performed each :math:`p` iterations: @@ -72,15 +72,18 @@ Computation Coordinate Descent algorithm is a special case of an iterative solver. For parameters, input, and output of iterative solvers, see :ref:`Iterative Solver > Computation `. -Algorithm parameters +Algorithm Parameters -------------------- In addition to the input of a iterative solver, Coordinate Descent algorithm accepts the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Coordinate Descent Computaion :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -102,7 +105,7 @@ In addition to the input of a iterative solver, Coordinate Descent algorithm acc - ``cyclic`` - Value that specifies the strategy of certain coordinate selection on each iteration. Except for default ``cyclic`` value, Coordinate Descent also supports: - + - ``random`` – on each iteration the index of coordinate is selected randomly by the engine. * - ``skipTheFirstComponents`` - ``false`` @@ -118,7 +121,7 @@ Examples - :cpp_example:`cd_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`CDDenseBatch.java ` diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/limited-memory-broyden-fletcher-goldfarb-shanno-algorithm.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/limited-memory-broyden-fletcher-goldfarb-shanno-algorithm.rst index 4c39a1c3b23..f44f932108a 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/limited-memory-broyden-fletcher-goldfarb-shanno-algorithm.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/limited-memory-broyden-fletcher-goldfarb-shanno-algorithm.rst @@ -118,9 +118,9 @@ For a given set of correction pairs :math:`(s_j, y_j)`, :math:`j = k - min(k, m) #. Iterate :math:`j` from :math:`k - min (k, m) + 1` until :math:`k`: - a. :math:`{\rho }_{j}=1/{y}_{j}^{T}{y}_{j}` + a. :math:`{\rho }_{j}=1/{y}_{j}^{T}{y}_{j}` - b. :math:`H:=\left(I-{\rho }_{j}{s}_{j}{y}_{j}^{T}\right)H\left(I-{\rho }_{j}{y}_{j}{s}_{j}^{T}\right)+{\rho }_{j}{s}_{j}{s}_{j}^{T}.` + b. :math:`H:=\left(I-{\rho }_{j}{s}_{j}{y}_{j}^{T}\right)H\left(I-{\rho }_{j}{y}_{j}{s}_{j}^{T}\right)+{\rho }_{j}{s}_{j}{s}_{j}^{T}.` #. Return :math:`H` @@ -137,10 +137,13 @@ Algorithm Input In addition to the input of the iterative solver, the limited-memory BFGS algorithm accepts the following optional input: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Limited-Memory Broyden-Fletcher-Goldfarb-Shanno Computaion :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - OptionalDataID - Input @@ -157,7 +160,7 @@ the limited-memory BFGS algorithm accepts the following optional input: - A numeric table of size :math:`2 \times p`, where row 0 represents average arguments for previous :math:`L` iterations, and row 1 represents average arguments for last :math:`L` iterations. These values are required to compute :math:`s` correction - vectors in the next step. + vectors in the next step. Algorithm Parameters -------------------- @@ -165,10 +168,13 @@ Algorithm Parameters In addition to parameters of the iterative solver, the limited-memory BFGS algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Limited-Memory Broyden-Fletcher-Goldfarb-Shanno Computaion :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -187,7 +193,7 @@ the limited-memory BFGS algorithm has the following parameters: implementation generates random indices. .. note:: - + This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. * - ``batchSize`` @@ -216,12 +222,12 @@ the limited-memory BFGS algorithm has the following parameters: implementation generates random indices. .. note:: - + This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. .. note:: - + If the algorithm runs with no optional input data, :math:`(nIterations / L - 1)` rows of the table are used. Otherwise, it can use one more row, :math:`(nIterations / L)` in total. * - :math:`m` @@ -240,10 +246,10 @@ the limited-memory BFGS algorithm has the following parameters: - :math:`size = 1 \times 1`: the value of step length at each iteration :math:`\alpha^1 = \ldots = \alpha^{nIterations}` ..note:: - + This parameter can be an object of any class derived from ``NumericTable``, except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. - + The recommended data type for storing the step-length sequence is the floating-point type, either float or double, that the algorithm uses in intermediate computations. @@ -258,10 +264,13 @@ Algorithm Output In addition to the output of the iterative solver, the limited-memory BFGS algorithm calculates the following optional results: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Limited-Memory Broyden-Fletcher-Goldfarb-Shanno Computaion :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - OptionalDataID - Output @@ -278,7 +287,7 @@ BFGS algorithm calculates the following optional results: - A numeric table of size :math:`2 \times p`, where row 0 represents average arguments for previous :math:`L` iterations, and row 1 represents average arguments for last :math:`L` iterations. These values are required to compute :math:`s` correction - vectors in the next step. + vectors in the next step. Examples -------- @@ -293,7 +302,7 @@ Examples - :cpp_example:`lbfgs_opt_res_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-average-gradient-accelerated-method.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-average-gradient-accelerated-method.rst index 6a1e52059be..dfd17450ceb 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-average-gradient-accelerated-method.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-average-gradient-accelerated-method.rst @@ -24,10 +24,6 @@ The Stochastic Average Gradient Accelerated (SAGA) [Defazio2014]_ follows The default method (``defaultDense``) of SAGA algorithm is a particular case of the iterative solver method with the batch size :math:`b = 1`. -.. contents:: - :local: - :depth: 1 - Details ******* @@ -40,7 +36,7 @@ and power :math:`d` of `Lebesgue space ` .. math:: G^t = (G_i^t)_{i = 1, \ldots, n} - + .. math:: G^0 \equiv (G_i^0)_{i = 1, \ldots, n} \equiv F_i'(\theta_0)_{i = 1, \ldots, n} @@ -52,7 +48,7 @@ and power :math:`d` of `Lebesgue space ` :math:`T(\theta_{t-1}, F_j'(\theta_{t-1}), S_{t-1}, M(\theta_{t-1}))`: #. :math:`W_t = \theta_{t-1} - \eta_j \left[ F_j'(\theta_{t-1}) - G_j^{t-1} + \frac{1}{n} \sum_{i=1}^{n} G_i^{t-1}\right]` - + #. :math:`\theta_t = \mathrm{prox}_{\eta}^{M} (W_t)` Update of the set of intrinsic parameters :math:`S_t`: @@ -79,17 +75,15 @@ Computation The stochastic average gradient (SAGA) algorithm is a special case of an iterative solver. For parameters, input, and output of iterative solvers, see :ref:`Iterative Solver > Computation `. -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- In addition to the :ref:`input of the iterative solver `, the SAGA optimization solver has the following optional input: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Input for Stochastic Average Gradient Accelerated Method Computaion :widths: 10 10 60 :align: left @@ -113,10 +107,13 @@ Algorithm Parameters In addition to parameters of the iterative solver, the SAGA optimization solver has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Stochastic Average Gradient Accelerated Method Computaion :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -156,7 +153,9 @@ Algorithm Output In addition to the :ref:`output of the iterative solver `, the SAGA optimization solver calculates the following optional result: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Output for Stochastic Average Gradient Accelerated Method Computaion :widths: 10 10 60 :align: left @@ -183,7 +182,7 @@ Examples - :cpp_example:`saga_logistic_loss_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-gradient-descent-algorithm.rst b/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-gradient-descent-algorithm.rst index 66eb1f5a232..4e976fb8bf2 100644 --- a/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-gradient-descent-algorithm.rst +++ b/docs/source/daal/algorithms/optimization-solvers/solvers/stochastic-gradient-descent-algorithm.rst @@ -114,10 +114,13 @@ gradient descent algorithm has the following parameters. Some of them are required only for specific values of the computation method parameter method: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for Stochastic Gradient Descent Algorithm Computaion :widths: 10 10 10 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - method @@ -160,7 +163,7 @@ method parameter method: - ``miniBatch``,``momentum`` - :math:`128` - The number of batch indices to compute the stochastic gradient. - + If ``batchSize`` equals the number of terms in the objective function, no random sampling is performed, and all terms are used to calculate the gradient. @@ -175,8 +178,8 @@ method parameter method: - The numeric table of size :math:`1 \times \text{nIterations}` or :math:`1 \times 1`. The contents of the table depend on its size: - - size = :math:`1 \times \text{nIterations}`: values of the conservative coefficient sequence :math:`\gamma^k` for :math:`k = 1, \ldots, \text{nIterations}`. - - size = :math:`1 \times 1` the value of conservative coefficient at each iteration :math:`\gamma^1 = \ldots = \gamma^\text{nIterations}`. + - size = :math:`1 \times \text{nIterations}`: values of the conservative coefficient sequence :math:`\gamma^k` for :math:`k = 1, \ldots, \text{nIterations}`. + - size = :math:`1 \times 1` the value of conservative coefficient at each iteration :math:`\gamma^1 = \ldots = \gamma^\text{nIterations}`. .. include: ../../../includes/parameter_numeric_table @@ -190,8 +193,8 @@ method parameter method: - The numeric table of size :math:`1 \times \text{nIterations}` or :math:`1 \times 1`. The contents of the table depend on its size: - - size = :math:`1 \times \text{nIterations}`: values of the learning rate sequence :math:`\eta^k` for :math:`k = 1, \ldots, \text{nIterations}`. - - size = :math:`1 \times 1`: the value of learning rate at each iteration :math:`\eta^1 = \ldots = \eta^\text{nIterations}`. + - size = :math:`1 \times \text{nIterations}`: values of the learning rate sequence :math:`\eta^k` for :math:`k = 1, \ldots, \text{nIterations}`. + - size = :math:`1 \times 1`: the value of learning rate at each iteration :math:`\eta^1 = \ldots = \eta^\text{nIterations}`. .. include: ../../../includes/parameter_numeric_table @@ -220,7 +223,7 @@ Examples - :cpp_example:`sgd_moment_opt_res_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/outlier_detection/multivariate-bacon.rst b/docs/source/daal/algorithms/outlier_detection/multivariate-bacon.rst index a44b3b92eec..f8081c74e87 100644 --- a/docs/source/daal/algorithms/outlier_detection/multivariate-bacon.rst +++ b/docs/source/daal/algorithms/outlier_detection/multivariate-bacon.rst @@ -70,7 +70,9 @@ The multivariate BACON outlier detection algorithm accepts the input described b Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Multivariate BACON Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -78,7 +80,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n \times p` numeric table with the data for outlier detection. - + .. note:: The input can be an object of any class derived from the ``NumericTable`` class. Algorithm Parameters @@ -86,10 +88,13 @@ Algorithm Parameters The multivariate BACON outlier detection algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Multivariate BACON Outlier Detection (Batch Processing) :header-rows: 1 :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -119,7 +124,9 @@ The multivariate BACON outlier detection algorithm calculates the result describ Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Multivariate BACON Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -128,7 +135,7 @@ For more details, see :ref:`algorithms`. * - ``weights`` - Pointer to the :math:`n \times 1` numeric table of zeros and ones. Zero in the :math:`i`-th position indicates that the :math:`i`-th feature vector is an outlier. - + .. note:: By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` @@ -146,7 +153,7 @@ Examples - :cpp_example:`out_detect_bacon_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/outlier_detection/multivariate.rst b/docs/source/daal/algorithms/outlier_detection/multivariate.rst index fe31c92b8a3..a6abd04d2c4 100644 --- a/docs/source/daal/algorithms/outlier_detection/multivariate.rst +++ b/docs/source/daal/algorithms/outlier_detection/multivariate.rst @@ -51,14 +51,17 @@ The multivariate outlier detection algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Multivariate Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``data`` - - Pointer to the :math:`n \times p` numeric table with the data for outlier detection. + - Pointer to the :math:`n \times p` numeric table with the data for outlier detection. The input can be an object of any class derived from the ``NumericTable`` class. * - ``location`` - Pointer to the :math:`1 \times p` numeric table with the vector of means. @@ -70,30 +73,34 @@ For more details, see :ref:`algorithms`. - Pointer to the :math:`1 \times 1` numeric table with the non-negative number that defines the outlier region. The input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. -.. note:: +If you do not provide at least one of the ``location``, ``scatter``, ``threshold`` inputs, +the library will initialize all of them with the following default values: + +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| - If you do not provide at least one of the ``location``, ``scatter``, ``threshold`` inputs, - the library will initialize all of them with the following default values: +.. list-table:: Default Values for Algorithm Input of Multivariate Outlier Detection (Batch Processing) + :widths: 10 20 + :class: longtable - .. list-table:: - :widths: 10 20 - - * - ``location`` - - A set of :math:`0.0` - * - ``scatter`` - - A numeric table with diagonal elements equal to :math:`1.0` and non-diagonal elements equal to :math:`0.0` - * - ``threshold`` - - :math:`3.0` + * - ``location`` + - A set of :math:`0.0` + * - ``scatter`` + - A numeric table with diagonal elements equal to :math:`1.0` and non-diagonal elements equal to :math:`0.0` + * - ``threshold`` + - :math:`3.0` Algorithm Parameters -------------------- The multivariate outlier detection algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Multivariate Outlier Detection (Batch Processing) :widths: 10 10 60 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -112,7 +119,9 @@ The multivariate outlier detection algorithm calculates the result described bel Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Multivariate Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -121,7 +130,7 @@ For more details, see :ref:`algorithms`. * - ``weights`` - Pointer to the :math:`n \times 1` numeric table of zeros and ones. Zero in the :math:`i`-th position indicates that the :math:`i`-th feature vector is an outlier. - + .. note:: By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` @@ -139,7 +148,7 @@ Examples - :cpp_example:`out_detect_mult_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/outlier_detection/univariate.rst b/docs/source/daal/algorithms/outlier_detection/univariate.rst index 41e2619e867..2cc4a55c160 100644 --- a/docs/source/daal/algorithms/outlier_detection/univariate.rst +++ b/docs/source/daal/algorithms/outlier_detection/univariate.rst @@ -23,7 +23,7 @@ Details ******* Given a set :math:`X` of :math:`n` feature vectors -:math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, +:math:`x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})` of dimension :math:`p`, the problem is to identify the vectors that do not belong to the underlying distribution (see [Ben2005]_ for exact definitions of an outlier). @@ -53,15 +53,18 @@ The univariate outlier detection algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Univariate Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``data`` - Pointer to the :math:`n \times p` numeric table with the data for outlier detection. - + .. note:: The input can be an object of any class derived from the ``NumericTable`` class. * - ``location`` - Pointer to the :math:`1 \times p` numeric table with the vector of means. @@ -72,33 +75,37 @@ For more details, see :ref:`algorithms`. .. note:: The input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. * - ``threshold`` - - Pointer to the :math:`1 \times p` numeric table with non-negative numbers that define the outlier region. + - Pointer to the :math:`1 \times p` numeric table with non-negative numbers that define the outlier region. .. note:: The input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. -.. note:: +If you do not provide at least one of the ``location``, ``scatter``, ``threshold`` inputs, +the library will initialize all of them with the following default values: - If you do not provide at least one of the ``location``, ``scatter``, ``threshold`` inputs, - the library will initialize all of them with the following default values: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| - .. list-table:: - :widths: 10 20 - - * - ``location`` - - A set of :math:`0.0` - * - ``scatter`` - - A set of :math:`1.0` - * - ``threshold`` - - A set of :math:`3.0` +.. list-table:: Default Values for Algorithm Input of Univariate Outlier Detection (Batch Processing) + :widths: 10 20 + :class: longtable + + * - ``location`` + - A set of :math:`0.0` + * - ``scatter`` + - A set of :math:`1.0` + * - ``threshold`` + - A set of :math:`3.0` Algorithm Parameters -------------------- The univariate outlier detection algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Univariate Outlier Detection (Batch Processing) :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -117,21 +124,23 @@ The univariate outlier detection algorithm calculates the result described below Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Univariate Outlier Detection (Batch Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``weights`` - - Pointer to the :math:`n \times p` numeric table of zeros and ones. - Zero in the position :math:`(i, j)` indicates an outlier in the :math:`i`-th observation of the :math:`j`-th feature. - - .. note:: - - By default, the result is an object of the ``HomogenNumericTable`` class, - but you can define the result as an object of any class derived from ``NumericTable`` - except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``СSRNumericTable``. + - Pointer to the :math:`n \times p` numeric table of zeros and ones. + Zero in the position :math:`(i, j)` indicates an outlier in the :math:`i`-th observation of the :math:`j`-th feature. + + .. note:: + + By default, the result is an object of the ``HomogenNumericTable`` class, + but you can define the result as an object of any class derived from ``NumericTable`` + except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``СSRNumericTable``. Examples ******** @@ -145,7 +154,7 @@ Examples - :cpp_example:`out_detect_uni_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/pca/computation-batch.rst b/docs/source/daal/algorithms/pca/computation-batch.rst index 822c68d7e1f..9528382eb18 100644 --- a/docs/source/daal/algorithms/pca/computation-batch.rst +++ b/docs/source/daal/algorithms/pca/computation-batch.rst @@ -17,32 +17,31 @@ Batch Processing **************** -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- The PCA algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Principal Component Analysis (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Input ID - Input * - ``data`` - Use when the input data is a normalized or non-normalized data set. Pointer to the :math:`n \times p` numeric table that contains the input data set. - + .. note:: This input can be an object of any class derived from ``NumericTable``. * - ``correlation`` - Use when the input data is a correlation matrix. Pointer to the :math:`p \times p` - numeric table that contains the correlation matrix. - + numeric table that contains the correlation matrix. + .. note:: This input can be an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix``. @@ -53,10 +52,13 @@ Algorithm Parameters The PCA algorithm has the following parameters, depending on the computation method parameter method: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.3}|\Y{0.4}| + +.. list-table:: Algorithm Parameters for Principal Component Analysis (Batch Processing) :widths: 10 10 15 25 :header-rows: 1 :align: left + :class: longtable * - Parameter - method @@ -77,7 +79,7 @@ computation method parameter method: - ``defaultDense`` - the correlation method - ``svdDense`` - the SVD method - For GPU: + For GPU: - ``defaultDense`` - the correlation method @@ -91,7 +93,7 @@ computation method parameter method: - ``svdDense`` - `SharedPtr>` - The data normalization algorithm to be used for PCA computations with - the SVD method. + the SVD method. * - ``nComponents`` - ``defaultDense``, ``svdDense`` - :math:`0` @@ -118,19 +120,22 @@ Algorithm Output The PCA algorithm calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of -your algorithm. +your algorithm. + +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| -.. list-table:: +.. list-table:: Algorithm Output for Principal Component Analysis (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left + :class: longtable * - Result ID - Result * - ``eigenvalues`` - Pointer to the :math:`1 \times p_r` numeric table that contains eigenvalues - in the descending order. - + in the descending order. + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` diff --git a/docs/source/daal/algorithms/pca/computation-distributed.rst b/docs/source/daal/algorithms/pca/computation-distributed.rst index 726884eeb76..a0ac6bdbe1e 100644 --- a/docs/source/daal/algorithms/pca/computation-distributed.rst +++ b/docs/source/daal/algorithms/pca/computation-distributed.rst @@ -23,19 +23,18 @@ This mode assumes that data set is split in nblocks blocks across computation no PCA computation in the distributed processing mode follows the general schema described in Algorithms. -.. contents:: - :local: - :depth: 1 - Algorithm Parameters -------------------- The PCA algorithm in the distributed processing mode has the following parameters, depending on the computation method parameter method: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for Principal Component Analysis (Distributed Processing) :widths: 10 10 10 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Method @@ -45,7 +44,7 @@ The PCA algorithm in the distributed processing mode has the following parameter - ``defaultDense`` or ``svdDense`` - Not applicable - The parameter required to initialize the algorithm. Can be: - + - ``step1Local`` - the first step, performed on local nodes - ``step2Master`` - the second step, performed on a master node * - ``algorithmFPType`` @@ -56,7 +55,7 @@ The PCA algorithm in the distributed processing mode has the following parameter - Not applicable - ``defaultDense`` - Available computation methods for PCA computation: - + - ``defaultDense`` - the correlation method - ``svdDense`` - the SVD method * - ``covariance`` @@ -80,7 +79,9 @@ Step 1 - on Local Nodes Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Input for Principal Component Analysis using Correlation method (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -94,28 +95,31 @@ Step 1 - on Local Nodes Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Output for Principal Component Analysis using Correlation method (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservationsCorrelation`` - Pointer to the :math:`1 \times 1` numeric table with the number of observations processed so far on the local node. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``crossProductCorrelation`` - Pointer to the :math:`p \times p` numeric table with the cross-product matrix computed so far on the local node. - + .. note:: By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``sumCorrelation`` - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far on the local node. - + .. note:: By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` @@ -127,7 +131,9 @@ Step 1 - on Local Nodes Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Input for Principal Component Analysis using SVD method (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -141,21 +147,24 @@ Step 1 - on Local Nodes Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Output for Principal Component Analysis using SVD method (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservationsCorrelation`` - Pointer to the :math:`1 \times 1` numeric table with the number of observations processed so far on the local node. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``sumSVD`` - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far on the local node. - + .. note:: By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` @@ -169,7 +178,7 @@ Step 1 - on Local Nodes except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``auxiliaryDataSVD`` - A collection of numeric tables each with the partial result to transmit to the master node for :ref:`Step 2 `. - + .. note:: The collection can contain objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. @@ -187,7 +196,9 @@ Step 2 - on Master Node Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Input for Principal Component Analysis using Correlation method (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -196,30 +207,33 @@ Step 2 - on Master Node * - ``partialResults`` - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``nObservationsCorrelation``, ``crossProductCorrelation``, and ``sumCorrelation``). - + .. note:: The collection can contain objects of any class derived from ``NumericTable`` - except the ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. + except the ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. In this step, PCA calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Output for Principal Component Analysis using Correlation method (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``eigenvalues`` - - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. + - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. * - ``eigenvectors`` - Pointer to the :math:`p \times p` numeric table that contains eigenvectors in the row-major order. .. note:: By default, these results are object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` - except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. + except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. .. group-tab:: SVD method (``svdDense``) @@ -227,7 +241,9 @@ Step 2 - on Master Node Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Input for Principal Component Analysis using SVD method (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -236,7 +252,7 @@ Step 2 - on Master Node * - ``partialResults`` - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``nObservationsSVD``, ``sumSVD``, ``sumSquaresSVD``, and ``auxiliaryDataSVD``). - + .. note:: The collection can contain objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. @@ -245,18 +261,21 @@ Step 2 - on Master Node Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Output for Principal Component Analysis using SVD method (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``eigenvalues`` - - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. + - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. * - ``eigenvectors`` - Pointer to the :math:`p \times p` numeric table that contains eigenvectors in the row-major order. .. note:: By default, these results are object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` - except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. + except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/pca/computation-online.rst b/docs/source/daal/algorithms/pca/computation-online.rst index e0a67f2596d..e86bf77e739 100644 --- a/docs/source/daal/algorithms/pca/computation-online.rst +++ b/docs/source/daal/algorithms/pca/computation-online.rst @@ -23,10 +23,6 @@ Online processing computation mode assumes that data arrives in blocks :math:`i PCA computation in the online processing mode follows the general computation schema for online processing described in :ref:`algorithms`. -.. contents:: - :local: - :depth: 1 - Algorithm Input --------------- @@ -34,7 +30,9 @@ The PCA algorithm in the online processing mode accepts the input described belo Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Principal Component Analysis (Online Processing) :widths: 10 60 :header-rows: 1 @@ -49,10 +47,13 @@ Algorithm Parameters The PCA algorithm in the online processing mode has the following parameters, depending on the computation method parameter method: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for Principal Component Analysis (Online Processing) :widths: 10 10 10 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Method @@ -66,7 +67,7 @@ The PCA algorithm in the online processing mode has the following parameters, de - Not applicable - ``defaultDense`` - Available computation methods for PCA computation: - + - ``defaultDense`` - the correlation method - ``svdDense`` - the SVD method * - ``initializationProcedure`` @@ -97,20 +98,23 @@ For more details, see :ref:`algorithms`. .. tab:: Correlation method (``defaultDense``) - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Partial Results for Principal Component Analysis using Correlation method (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservationsCorrelation`` - Pointer to the :math:`1 \times 1` numeric table with the number of observations processed so far. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``crossProductCorrelation`` - - Pointer to the :math:`p \times p` numeric table with the partial cross-product matrix computed so far. + - Pointer to the :math:`p \times p` numeric table with the partial cross-product matrix computed so far. .. note:: @@ -119,7 +123,7 @@ For more details, see :ref:`algorithms`. except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``sumCorrelation`` - - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far. + - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far. .. note:: @@ -130,20 +134,23 @@ For more details, see :ref:`algorithms`. .. tab:: SVD method (``svdDense``) - .. list-table:: + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Partial Results for Principal Component Analysis using SVD method (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``nObservationsCorrelation`` - Pointer to the :math:`1 \times 1` numeric table with the number of observations processed so far. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``CSRNumericTable``. * - ``sumSVD`` - - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far. + - Pointer to the :math:`1 \times p` numeric table with partial sums computed so far. .. note:: @@ -167,17 +174,20 @@ The PCA algorithm in the online processing mode calculates the results described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Principal Component Analysis (Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``eigenvalues`` - - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. + - Pointer to the :math:`1 \times p` numeric table that contains eigenvalues in the descending order. * - ``eigenvectors`` - Pointer to the :math:`p \times p` numeric table that contains eigenvectors in the row-major order. - + .. note:: By default, these results are objects of the ``HomogenNumericTable`` class, diff --git a/docs/source/daal/algorithms/pca/principal-component-analysis.rst b/docs/source/daal/algorithms/pca/principal-component-analysis.rst index 54c81285bf3..e5164ccb3ba 100644 --- a/docs/source/daal/algorithms/pca/principal-component-analysis.rst +++ b/docs/source/daal/algorithms/pca/principal-component-analysis.rst @@ -46,7 +46,7 @@ Details ******* Given a set :math:`X = \{x_1 = (x_{11}, \ldots, x_{1p}), \ldots, x_n = (x_{n1}, \ldots, x_{np})\}` of :math:`p`-dimensional -feature vectors or a :math:`p \times p` correlation matrix and the number of principal components :math:`p_r`, +feature vectors or a :math:`p \times p` correlation matrix and the number of principal components :math:`p_r`, the problem is to compute :math:`p_r` principal directions (eigenvectors) for the data set. The library returns the transformation matrix :math:`T` of size :math:`p_r \times p`, which contains @@ -62,19 +62,19 @@ Eigenvectors computed by PCA are not uniquely defined due to sign ambiguity. PCA supports fast ad-hoc "sign flip" technique described in the paper [Bro07]_. It modifies the signs of eigenvectors shown below: - .. math:: - \hat{T_i} = T_i \cdot sgn(\max_{1 \leq j \leq p } |{T}_{i,j}|), i=1, \ldots ,p_r +.. math:: + \hat{T_i} = T_i \cdot sgn(\max_{1 \leq j \leq p } |{T}_{i,j}|), i=1, \ldots ,p_r where :math:`T`-transformation matrix is computed by PCA, :math:`T_i` - :math:`i`-th row in the matrix, :math:`j` - column number, :math:`sgn` - signum function: - .. math:: - sgn(x) = - \begin{cases} - -1, & x < 0,\\ - 0, & x = 0, \\ - 1, & x > 0 - \end{cases} +.. math:: + sgn(x) = + \begin{cases} + -1, & x < 0,\\ + 0, & x = 0, \\ + 1, & x > 0 + \end{cases} You can provide these types of input data to the PCA algorithms of the library: @@ -92,7 +92,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch.rst computation-online.rst computation-distributed.rst @@ -135,7 +135,7 @@ Examples - :cpp_example:`pca_svd_dense_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -152,9 +152,9 @@ Examples Distributed Processing: - - :java_example:`PCACorDenseDistr.java ` - - :java_example:`PCACorCSRDistr.java ` - - :java_example:`PCASVDDenseDistr.java ` + - :java_example:`PCACorDenseDistr.java ` + - :java_example:`PCACorCSRDistr.java ` + - :java_example:`PCASVDDenseDistr.java ` .. tab:: Python* with DPC++ support diff --git a/docs/source/daal/algorithms/pca/transform.rst b/docs/source/daal/algorithms/pca/transform.rst index 908ba1d36cd..f9bd13fffb1 100644 --- a/docs/source/daal/algorithms/pca/transform.rst +++ b/docs/source/daal/algorithms/pca/transform.rst @@ -36,20 +36,23 @@ The PCA Transform algorithm accepts the input described below. Pass the ```Input ID``` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Principal Components Analysis Transform (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``data`` - Use when the input data is a normalized or non-normalized data set. - Pointer to the :math:`n \times p` numeric table that contains the input data set. + Pointer to the :math:`n \times p` numeric table that contains the input data set. This input can be an object of any class derived from ``NumericTable``. * - ``eigenvectors`` - Principal components computed using the PCA algorithm. - + Pointer to the :math:`p_r \times p` numeric table :math:`(p_r \leq p)`. You can define it as an object of any class derived from ``NumericTable``, except for ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -63,11 +66,11 @@ For more details, see :ref:`algorithms`. eigenvalue eigenvalues - .. note:: - + .. note:: + - If you do not provide the collection, the library will not apply the corresponding centering, normalization or whitening operation. - - If one of the numeric tables in collection is ``NULL``, the corresponding operation will not be applied: centering for means, normalization for variances, whitening for eigenvalues. - - If mean or variance tables exist, it should be a pointer to the :math:`1 \times p` numeric table. + - If one of the numeric tables in collection is ``NULL``, the corresponding operation will not be applied: centering for means, normalization for variances, whitening for eigenvalues. + - If mean or variance tables exist, it should be a pointer to the :math:`1 \times p` numeric table. - If eigenvalue table is not ``NULL``, it is the pointer to (:math:`1 \times \text{nColumns}`) numeric table, where the number of the columns is greater than or equal to ``nComponents``. Algorithm Parameters @@ -75,10 +78,13 @@ Algorithm Parameters The PCA Transform algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Algorithm Parameters for Principal Components Analysis Transform (Batch Processing) :header-rows: 1 - :widths: 10 10 10 60 + :widths: 10 10 10 60 :align: left + :class: longtable * - Parameter - method @@ -100,15 +106,17 @@ Algorithm Output The PCA Transform algorithm calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Principal Components Analysis Transform (Batch Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``transformedData`` - - Pointer to the :math:`n \times p_r` numeric table that contains data projected to the principal components basis. - + - Pointer to the :math:`n \times p_r` numeric table that contains data projected to the principal components basis. + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object @@ -122,11 +130,11 @@ Examples .. tab:: C++ (CPU) Batch Processing: - + - :cpp_example:`pca_transform_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/qr/qr-pivoted.rst b/docs/source/daal/algorithms/qr/qr-pivoted.rst index 877f15e6537..a7db4da3222 100644 --- a/docs/source/daal/algorithms/qr/qr-pivoted.rst +++ b/docs/source/daal/algorithms/qr/qr-pivoted.rst @@ -42,7 +42,9 @@ Pivoted QR decomposition accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Pivoted QR Decomposition (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -57,10 +59,13 @@ Algorithm Parameters Pivoted QR decomposition has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Pivoted QR Decomposition (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -73,7 +78,7 @@ Pivoted QR decomposition has the following parameters: - Performance-oriented computation method, the only method supported by the algorithm. * - ``permutedColumns`` - Not applicable - - Pointer to the numeric table with the :math:`1 \times p` matrix with the information for the permutation: + - Pointer to the numeric table with the :math:`1 \times p` matrix with the information for the permutation: - If the :math:`i`-th element is zero, the :math:`i`-th column of the input matrix is a free column and may be permuted with any other free column during the computation. @@ -94,34 +99,37 @@ Pivoted QR decomposition calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Pivoted QR Decomposition (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``matrixQ`` - - Pointer to the numeric table with the :math:`n \times p` matrix :math:`Q_1`. - + - Pointer to the numeric table with the :math:`n \times p` matrix :math:`Q_1`. + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``matrixR`` - Pointer to the numeric table with the :math:`p \times p` upper triangular matrix :math:`R_1`. - - .. note:: + + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class - derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, + derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. * - ``permutationMatrix`` - Pointer to the numeric table with the :math:`1 \times p` matrix such that :math:`\text{permutationMatrix}(i) = k` if the column :math:`k` of the full matrix :math:`X` is permuted into the position :math:`i` in :math:`XP`. - .. note:: + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class - derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, + derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. Examples @@ -136,7 +144,7 @@ Examples - :cpp_example:`pivoted_qr_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/qr/qr-without-pivoting.rst b/docs/source/daal/algorithms/qr/qr-without-pivoting.rst index b5318a38eb3..31d2830adfa 100644 --- a/docs/source/daal/algorithms/qr/qr-without-pivoting.rst +++ b/docs/source/daal/algorithms/qr/qr-without-pivoting.rst @@ -38,7 +38,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + without-pivoting/computation-batch-online.rst without-pivoting/computation-distributed.rst @@ -62,7 +62,7 @@ Examples - :cpp_example:`qr_dense_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/qr/without-pivoting/computation-batch-online.rst b/docs/source/daal/algorithms/qr/without-pivoting/computation-batch-online.rst index da6ae2bc649..a5cd24f7bba 100644 --- a/docs/source/daal/algorithms/qr/without-pivoting/computation-batch-online.rst +++ b/docs/source/daal/algorithms/qr/without-pivoting/computation-batch-online.rst @@ -26,7 +26,9 @@ QR decomposition accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for QR Decomposition without Pivoting (Batch and Online Processing) :widths: 10 60 :header-rows: 1 @@ -37,7 +39,7 @@ For more details, see :ref:`algorithms`. - For batch processing: the entire :math:`n \times p` matrix :math:`X` to be factorized. - For online processing: the :math:`n_i \times p` submatrix of :math:`X` that represents - the current data block in the online processing mode. + the current data block in the online processing mode. Note that each current data block must have sufficient size: :math:`n_i > p`. The input can be an object of any class derived from ``NumericTable``. @@ -47,10 +49,13 @@ Algorithm Parameters QR decomposition has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for QR Decomposition without Pivoting (Batch and Online Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -69,15 +74,18 @@ QR decomposition calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for QR Decomposition without Pivoting (Batch and Online Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``matrixQ`` - - Pointer to the numeric table with the :math:`n \times p` matrix :math:`Q_1`. - + - Pointer to the numeric table with the :math:`n \times p` matrix :math:`Q_1`. + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -85,7 +93,7 @@ For more details, see :ref:`algorithms`. * - ``matrixR`` - Pointer to the numeric table with the :math:`p \times p` upper triangular matrix :math:`R_1`. - .. note:: + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class - derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, + derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. diff --git a/docs/source/daal/algorithms/qr/without-pivoting/computation-distributed.rst b/docs/source/daal/algorithms/qr/without-pivoting/computation-distributed.rst index f0e03c0f820..4903e7e212c 100644 --- a/docs/source/daal/algorithms/qr/without-pivoting/computation-distributed.rst +++ b/docs/source/daal/algorithms/qr/without-pivoting/computation-distributed.rst @@ -24,9 +24,12 @@ Algorithm Parameters QR decomposition in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for QR Decomposition without Pivoting (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -53,14 +56,19 @@ Use the three-step computation schema to compute QR decomposition: Step 1 - on Local Nodes *********************** -.. image:: images/qr-without-pivoting-distributed-step-1.png +.. figure:: images/qr-without-pivoting-distributed-step-1.png :width: 800 + :alt: + + QR Decomposition without Pivoting: Distributed Processing, Step 1 - on Local Nodes In this step, QR decomposition accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for QR Decomposition without Pivoting (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -69,32 +77,35 @@ For more details, see :ref:`algorithms`. * - ``data`` - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. Note that each data block must have sufficient size: :math:`n_i > p`. - + .. note:: The input can be an object of any class derived from ``NumericTable``. In this step, QR decomposition calculates the results described below. Pass the ``Partial Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for QR Decomposition without Pivoting (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result * - ``outputOfStep1ForStep2`` - A collection that contains numeric tables each with the partial result to transmit to the master node for :ref:`Step 2 `. - + .. note:: - + By default, these tables are objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. * - ``outputOfStep1ForStep3`` - A collection that contains numeric tables each with the partial result to keep on the local node for :ref:`Step 3 `. - + .. note:: - + By default, these tables are objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -104,24 +115,30 @@ For more details, see :ref:`algorithms`. Step 2 - on Master Node *********************** -.. image:: images/qr-without-pivoting-distributed-step-2.png +.. figure:: images/qr-without-pivoting-distributed-step-2.png :width: 800 + :alt: + + QR Decomposition without Pivoting: Distributed Processing, Step 2 - on Master Node In this step, QR decomposition accepts the input from each local node described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for QR Decomposition without Pivoting (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``inputOfStep2FromStep1`` - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``outputOfStep1ForStep2``). - + .. note:: - + This collection can contain objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. * - ``key`` @@ -133,7 +150,9 @@ In this step, QR decomposition calculates the results described below. Pass the ``Result ID`` or ``Partial Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for QR Decomposition without Pivoting (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -141,14 +160,16 @@ For more details, see :ref:`algorithms`. - Result * - ``outputOfStep2ForStep3`` - A collection that contains numeric tables to be split across local nodes to compute :math:`Q_1`. - + .. note:: - + By default, these tables are objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for QR Decomposition without Pivoting (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -156,9 +177,9 @@ For more details, see :ref:`algorithms`. - Result * - ``matrixR`` - Pointer to the numeric table with the :math:`p \times p` upper triangular matrix :math:`R_1`. - + .. note:: - + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class, ``CSRNumericTable`` class, and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. @@ -168,31 +189,37 @@ For more details, see :ref:`algorithms`. Step 3 - on Local Nodes *********************** -.. image:: images/qr-without-pivoting-distributed-step-3.png +.. figure:: images/qr-without-pivoting-distributed-step-3.png :width: 800 + :alt: + + QR Decomposition without Pivoting: Distributed Processing, Step 3 - on Local Nodes In this step, QR decomposition accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for QR Decomposition without Pivoting (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``inputOfStep3FromStep1`` - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``outputOfStep1ForStep3``). - + .. note:: - + The collection can contain objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. * - ``inputOfStep3FromStep2`` - A collection that contains results computed in :ref:`Step 2 ` on local nodes (``outputOfStep2ForStep3``). - + .. note:: - + The collection can contain objects of any class derived from ``NumericTable`` except the ``PackedSymmetricMatrix`` class and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. @@ -200,7 +227,9 @@ In this step, QR decomposition calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for QR Decomposition without Pivoting (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 @@ -208,9 +237,9 @@ For more details, see :ref:`algorithms`. - Result * - ``matrixQ`` - Pointer to the numeric table with the :math:`n \times p` matrix :math:`Q_1`. - + .. note:: - + By default, the result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/quality_metrics/default/for-binary-classification.rst b/docs/source/daal/algorithms/quality_metrics/default/for-binary-classification.rst index c0d745de4ba..2687fc386e3 100644 --- a/docs/source/daal/algorithms/quality_metrics/default/for-binary-classification.rst +++ b/docs/source/daal/algorithms/quality_metrics/default/for-binary-classification.rst @@ -14,6 +14,8 @@ .. * limitations under the License. .. *******************************************************************************/ +.. _quality_metrics_for_binary_classification: + Quality Metrics for Binary Classification Algorithms ==================================================== @@ -29,8 +31,11 @@ Details Further definitions use the following notations: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Notations for Quality Metrics for Binary Classification Algorithms :widths: 10 10 30 + :class: longtable * - :math:`\text{tp}` - true positive @@ -47,9 +52,12 @@ Further definitions use the following notations: The library uses the following quality metrics for binary classifiers: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Definitions of Quality Metrics for Binary Classification Algorithms :widths: 10 10 :header-rows: 1 + :class: longtable * - Quality Metric - Definition @@ -70,16 +78,18 @@ For more details of these metrics, including the evaluation focus, refer to [Sok The confusion matrix is defined as follows: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.4}|\Y{0.3}| + +.. list-table:: Confusion Matrix for Binary Classification Algorithms :header-rows: 1 :stub-columns: 1 - * - + * - - Classified as Class :math:`C_1` - Classified as Class :math:`C_2` * - Actual Class :math:`C_1` - `tp` - - `fn` + - `fn` * - Actual Class :math:`C_2` - `fp` - `tn` @@ -94,19 +104,22 @@ The quality metric algorithm for binary classifiers accepts the input described Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Quality Metrics for Binary Classification (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``predictedLabels`` - Pointer to the :math:`n \times 1` numeric table that contains labels computed at the prediction stage of the classification algorithm. - + This input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``groundTruthLabels`` - - Pointer to the :math:`n \times 1` numeric table that contains expected labels. - + - Pointer to the :math:`n \times 1` numeric table that contains expected labels. + This input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. Algorithm Parameters @@ -114,10 +127,13 @@ Algorithm Parameters The quality metric algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Quality Metrics for Binary Classification (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -135,19 +151,22 @@ The quality metric algorithm has the following parameters: Algorithm Output ---------------- -The quality metric algorithm calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The quality metric algorithm calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Quality Metrics for Binary Classification (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``confusionMatrix`` - Pointer to the :math:`2 \times 2` numeric table with the confusion matrix. - + .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from NumericTable except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. @@ -177,7 +196,7 @@ Examples - :cpp_example:`svm_two_class_metrics_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/quality_metrics/default/for-linear-regression.rst b/docs/source/daal/algorithms/quality_metrics/default/for-linear-regression.rst index 73552ba96cf..ddfa3255fda 100644 --- a/docs/source/daal/algorithms/quality_metrics/default/for-linear-regression.rst +++ b/docs/source/daal/algorithms/quality_metrics/default/for-linear-regression.rst @@ -49,9 +49,12 @@ Testing Insignificance of a Single Beta The library uses the following quality metrics: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Quality Metrics for Testing Insignificance of a Single Beta :widths: 10 10 :header-rows: 1 + :class: longtable * - Quality Metric - Definition @@ -78,9 +81,12 @@ Testing Insignificance of a Group of Betas The library uses the following quality metrics: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Quality Metrics for Testing Insignificance of a Group of Betas :widths: 10 10 :header-rows: 1 + :class: longtable * - Quality Metric - Definition @@ -99,7 +105,7 @@ The library uses the following quality metrics: * - F-statistics used in testing insignificance of a group of betas :math:`F = (F_1, \ldots, F_k)` - :math:`F_j = \frac {(\text{ResSS}_{0j} - \text{ResSS}_j)/(p - p_0)} {{\text{ResSS}_j}/(n - p - 1)}`, :math:`j = 1, \ldots, k`, - where :math:`\text{ResSS}_j` are computed for a model with :math:`p + 1` betas and + where :math:`\text{ResSS}_j` are computed for a model with :math:`p + 1` betas and :math:`\text{ResSS}_{0j}` are computed for a reduced model with :math:`p_0 + 1` betas (:math:`p - p_0` betas are set to zero) Batch Processing @@ -119,33 +125,39 @@ The quality metric algorithm for linear regression accepts the input described b Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Testing Insignificance of a Single Beta in Linear Regression (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``expectedResponses`` - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) used for training the linear regression model. - + This table can be an object of any class derived from ``NumericTable``. * - ``model`` - - Pointer to the model computed at the training stage of the linear regression algorithm. - + - Pointer to the model computed at the training stage of the linear regression algorithm. + The model can only be an object of the ``linear_regression::Model`` class. * - ``predictedResponses`` - - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) computed at the prediction stage of the linear regression algorithm. - + - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) computed at the prediction stage of the linear regression algorithm. + This table can be an object of any class derived from ``NumericTable``. .. rubric:: Algorithm Parameters The quality metric algorithm for linear regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Testing Insignificance of a Single Beta in Linear Regression (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -166,13 +178,16 @@ The quality metric algorithm for linear regression has the following parameters: .. rubric:: Algorithm Output -The quality metric algorithm for linear regression calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The quality metric algorithm for linear regression calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Testing Insignificance of a Single Beta in Linear Regression (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result @@ -192,7 +207,7 @@ For more details, see :ref:`algorithms`. * - ``betaCovariances`` - Pointer to the DataCollection object that contains :math:`k` numeric tables, each with the :math:`m \times m` variance-covariance matrix for betas of the j-th response (dependent variable), where m is the number of betas in the model (m is equal to p when interceptFlag is set to false at the training stage of the linear regression algorithm; otherwise, m is equal to p + 1 ). - + The collection can contain objects of any class derived from ``NumericTable``. * - ``zScore`` - Pointer to the :math:`k \times m` numeric table that contains the Z-score statistics used in the testing of insignificance of individual linear regression coefficients, @@ -212,7 +227,7 @@ For more details, see :ref:`algorithms`. computed for the :math:`j`-th beta of the :math:`t`-th response (dependent variable), where :math:`m` is the number of betas in the model (:math:`m` is equal to :math:`p` when ``interceptFlag`` is set to ``false`` at the training stage - of the linear regression algorithm; otherwise, :math:`m` is equal to :math:`p + 1`). + of the linear regression algorithm; otherwise, :math:`m` is equal to :math:`p + 1`). .. note:: By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class @@ -231,38 +246,44 @@ Testing Insignificance of a Group of Betas .. rubric:: Algorithm Input -The quality metric algorithm for linear regression accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +The quality metric algorithm for linear regression accepts the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Testing Insignificance of a Group of Betas in Linear Regression (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``expectedResponses`` - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) used for training the linear regression model. - + This table can be an object of any class derived from ``NumericTable``. * - ``predictedResponses`` - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) computed at the prediction stage of the linear regression algorithm. - + This table can be an object of any class derived from ``NumericTable``. * - ``predictedReducedModelResponses`` - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables) computed at the prediction stage of the linear regression algorithm using the reduced linear regression model, where :math:`p - p_0` out of :math:`p` beta coefficients are set to zero. - + This table can be an object of any class derived from ``NumericTable``. .. rubric:: Algorithm Parameters The quality metric algorithm for linear regression has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Testing Insignificance of a Group of Betas in Linear Regression (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -283,13 +304,16 @@ The quality metric algorithm for linear regression has the following parameters: .. rubric:: Algorithm Output -The quality metric algorithm for linear regression calculates the result described below. -Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. +The quality metric algorithm for linear regression calculates the result described below. +Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Testing Insignificance of a Group of Betas in Linear Regression (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result @@ -300,13 +324,13 @@ For more details, see :ref:`algorithms`. * - ``regSS`` - Pointer to the :math:`1 \times k` numeric table that contains the regression sum of squares computed for each dependent variable. * - ``resSS`` - - Pointer to the :math:`1 \times k` numeric table that contains the sum of squares of residuals computed for each dependent variable. + - Pointer to the :math:`1 \times k` numeric table that contains the sum of squares of residuals computed for each dependent variable. * - ``tSS`` - Pointer to the :math:`1 \times k` numeric table that contains the total sum of squares computed for each dependent variable. * - ``determinationCoeff`` - Pointer to the :math:`1 \times k` numeric table that contains the determination coefficient computed for each dependent variable. * - ``fStatistics`` - - Pointer to the :math:`1 \times k` numeric table that contains the F-statistics computed for each dependent variable. + - Pointer to the :math:`1 \times k` numeric table that contains the F-statistics computed for each dependent variable. .. note:: By default, these results are objects of the ``HomogenNumericTable`` class, but you can define the result as an object of any class @@ -325,7 +349,7 @@ Examples - :cpp_example:`lin_reg_metrics_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/quality_metrics/default/for-multi-class-classification.rst b/docs/source/daal/algorithms/quality_metrics/default/for-multi-class-classification.rst index f3fa3ccbf7a..56c28f72850 100644 --- a/docs/source/daal/algorithms/quality_metrics/default/for-multi-class-classification.rst +++ b/docs/source/daal/algorithms/quality_metrics/default/for-multi-class-classification.rst @@ -14,6 +14,8 @@ .. * limitations under the License. .. *******************************************************************************/ +.. _quality_metrics_for_multi_class_classification: + Quality Metrics for Multi-class Classification Algorithms ========================================================= @@ -30,8 +32,11 @@ Details Further definitions use the following notations: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Notations for Quality Metrics for Multi-class Classification Algorithms :widths: 10 10 30 + :class: longtable * - :math:`\text{tp}_i` - true positive @@ -48,9 +53,12 @@ Further definitions use the following notations: The library uses the following quality metrics for multi-class classifiers: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Definitions of Quality Metrics for Multi-class Classification Algorithms :widths: 10 10 :header-rows: 1 + :class: longtable * - Quality Metric - Definition @@ -70,12 +78,12 @@ The library uses the following quality metrics for multi-class classifiers: - :math:`\frac {\sum _{i = 1}^{l} \frac {\text{tp}_i}{\text{tp}_i + \text{fn}_i}}{l}` * - Macro F-score (:math:`\text{F-score}_M`) - :math:`\frac {(\beta^2 + 1)(\text{Precision}_M \times \text{Recall}_M)}{\beta^2 \times \text{Precision}_M + \text{Recall}_M}` - + For more details of these metrics, including the evaluation focus, refer to [Sokolova09]_. The following is the confusion matrix: -.. list-table:: +.. list-table:: Confusion Matrix for Multi-class Classification Algorithms :header-rows: 1 :stub-columns: 1 @@ -136,23 +144,26 @@ Batch Processing Algorithm Input --------------- -The quality metric algorithm for multi-class classifiers accepts the input described below. -Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. +The quality metric algorithm for multi-class classifiers accepts the input described below. +Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Quality Metrics for Multi-class Classification Algorithms (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``predictedLabels`` - Pointer to the :math:`n \times 1` numeric table that contains labels computed at the prediction stage of the classification algorithm. - + This input can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``groundTruthLabels`` - Pointer to the :math:`n \times 1` numeric table that contains expected labels. - + This input can be an object of any class derived from NumericTable except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. Algorithm Parameters @@ -160,10 +171,13 @@ Algorithm Parameters The quality metric algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Quality Metrics for Multi-class Classification Algorithms (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -189,18 +203,21 @@ Algorithm Output The quality metric algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see Algorithms. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Quality Metrics for Multi-class Classification Algorithms (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``confusionMatrix`` - Pointer to the :math:`\text{nClasses} \times \text{nClasses}` numeric table with the confusion matrix. - + .. note:: - By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object - of any class derived from NumericTable except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object + of any class derived from NumericTable except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. * - ``multiClassMetrics`` - Pointer to the :math:`1 \times 8` numeric table that contains quality metrics, which you can access by an appropriate Multi-class Metrics ID: @@ -214,8 +231,8 @@ The quality metric algorithm calculates the result described below. Pass the ``R - ``macroFscore`` - macro F-score .. note:: - By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object - of any class derived from NumericTable except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object + of any class derived from NumericTable except ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. Examples ******** @@ -229,7 +246,7 @@ Examples - :cpp_example:`svm_multi_class_metrics_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/quality_metrics/default/for-pca.rst b/docs/source/daal/algorithms/quality_metrics/default/for-pca.rst index 7beff45eee5..687baf3b9b6 100644 --- a/docs/source/daal/algorithms/quality_metrics/default/for-pca.rst +++ b/docs/source/daal/algorithms/quality_metrics/default/for-pca.rst @@ -18,7 +18,7 @@ Quality Metrics for Principal Components Analysis ================================================= Given the results of the PCA algorithm, data set :math:`E = (e_i)`, :math:`i = \overline{1, p}` -of eigenvalues in decreasing order, full number of principal components :math:`p` and reduced number +of eigenvalues in decreasing order, full number of principal components :math:`p` and reduced number of components :math:`p_r \leq p`, the problem is to evaluate the explained variances radio and noise variance. ``QualityMetricsId`` for the PCA algorithm is ``explainedVarianceMetrics``. @@ -29,7 +29,7 @@ Details The metrics are computed given the input data meets the following requirements: - At least the largest eigenvalue :math:`e_0` is non-zero. Returns an error otherwise. -- The number of eigenvalues :math:`p` must be equal to the number of features provided. +- The number of eigenvalues :math:`p` must be equal to the number of features provided. Returns an error if :math:`p` is less than the number of features. The PCA algorithm receives input argument eigenvalues :math:`e_k`, :math:`k = \overline{1, p}`. @@ -40,9 +40,12 @@ It represents the following quality metrics: The library uses the following quality metrics: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Quality Metrics for Principal Components Analysis :widths: 10 10 :header-rows: 1 + :class: longtable * - Quality Metric - Definition @@ -52,10 +55,10 @@ The library uses the following quality metrics: - :math:`r_k = \frac {e_k}{\sum _{i = 1}^{p} e_i}`, :math:`k = \overline{1, p}` * - Noise variance - .. math:: - v_\text{noise} = + v_\text{noise} = \begin{cases} 0, & p_r = p;\\ - \frac{1}{p - p_r} \sum _{i = p_r + 1}^{p} e_i, & p_r < p + \frac{1}{p - p_r} \sum _{i = p_r + 1}^{p} e_i, & p_r < p \end{cases} .. note:: @@ -73,15 +76,17 @@ The Quality Metrics for PCA algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Quality Metrics for Principal Components Analysis (Batch Processing) :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``eigenvalues`` - - :math:`p` eigenvalues (explained variances), numeric table of size :math:`1 \times p`. - + - :math:`p` eigenvalues (explained variances), numeric table of size :math:`1 \times p`. + You can define it as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. Algorithm Parameters @@ -89,10 +94,13 @@ Algorithm Parameters The quality metric algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Quality Metrics for Principal Components Analysis (Batch Processing) :header-rows: 1 - :widths: 10 10 60 + :widths: 10 10 60 :align: left + :class: longtable * - Parameter - Default Value @@ -102,13 +110,13 @@ The quality metric algorithm has the following parameters: - The floating-point type that the algorithm uses for intermediate computations. Can be ``float`` or ``double``. * - ``nComponents`` - :math:`0` - - The number of principal components :math:`p_r \leq p` to compute metrics for. + - The number of principal components :math:`p_r \leq p` to compute metrics for. If it is zero, the algorithm will compute the result for :math:`p`. * - ``nFeatures`` - :math:`0` - - The number of features in the data set used as input in PCA algorithm. - If it is zero, the algorithm will compute the result for p. - + - The number of features in the data set used as input in PCA algorithm. + If it is zero, the algorithm will compute the result for p. + .. note:: if :math:`\text{nFeatures} \neq p`, the algorithm will return non-relevant results. Algorithm Output @@ -117,9 +125,12 @@ Algorithm Output The quality metric for PCA algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Quality Metrics for Principal Components Analysis (Batch Processing) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result @@ -146,7 +157,7 @@ Examples - :cpp_example:`pca_metrics_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/quantiles/index.rst b/docs/source/daal/algorithms/quantiles/index.rst index 35b3feb6cf9..3b26e7743d8 100644 --- a/docs/source/daal/algorithms/quantiles/index.rst +++ b/docs/source/daal/algorithms/quantiles/index.rst @@ -32,7 +32,7 @@ the problem is to compute :math:`z_{ik}` that meets the following conditions: .. math:: P\{\xi_i > z_{ik} \} \leq 1 - \beta_k - + In the equations above: - :math:`x_i = (x_{1i}, \ldots, x_{ni})` are observations of a random variable :math:`\xi_i` that represents the :math:`i`-th feature @@ -50,7 +50,9 @@ The quantile algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Quantile (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -65,9 +67,12 @@ Algorithm Parameters The quantile algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Quantile (Batch Processing) :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -89,15 +94,17 @@ The quantile algorithm calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Quantile (Batch Processing) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``quantiles`` - - Pointer to the :math:`p \times m` numeric table with the quantiles. - + - Pointer to the :math:`p \times m` numeric table with the quantiles. + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -113,7 +120,7 @@ Examples - :cpp_example:`quantiles_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/sorting/index.rst b/docs/source/daal/algorithms/sorting/index.rst index e6f6f9eae68..eac899c7c2b 100644 --- a/docs/source/daal/algorithms/sorting/index.rst +++ b/docs/source/daal/algorithms/sorting/index.rst @@ -19,7 +19,7 @@ Sorting In |short_name| sorting is an algorithm to sort the observations by each feature (column) in the ascending order. -The result of the sorting algorithm applied to the matrix +The result of the sorting algorithm applied to the matrix :math:`X = (x_{ij})_{n \times p}` is the matrix :math:`Y = (y_{ij})_{n \times p}` where the :math:`j`-th column :math:`(Y)_j = ( y_{ij} )`, :math:`i = 1, \ldots, n`, is the column :math:`(X)_j = ( x_{ij} )`, :math:`i = 1, \ldots, n`, sorted in the ascending order. @@ -34,7 +34,9 @@ The sorting algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Sorting (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -42,7 +44,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n \times p` numeric table that contains the input data set. - + This table can be an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -51,10 +53,13 @@ Algorithm Parameters The sorting algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.7}| + +.. list-table:: Algorithm Parameters for Sorting (Batch Processing) :header-rows: 1 :align: left :widths: 10 10 60 + :class: longtable * - Parameter - Default Value @@ -65,7 +70,7 @@ The sorting algorithm has the following parameters: * - ``method`` - ``defaultDense`` - The radix method for sorting a data set, the only method supported by the algorithm. - + Algorithm Output ---------------- @@ -74,7 +79,9 @@ The sorting algorithm function calculates the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Sorting (Batch Processing) :widths: 10 60 :header-rows: 1 @@ -100,7 +107,7 @@ Examples - :cpp_example:`sorting_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/algorithms/stump/classification.rst b/docs/source/daal/algorithms/stump/classification.rst index 024fd51f349..c487b0e4d5c 100644 --- a/docs/source/daal/algorithms/stump/classification.rst +++ b/docs/source/daal/algorithms/stump/classification.rst @@ -19,8 +19,8 @@ Classification Stump A Classification Decision Stump is a model that consists of a one-level decision tree where the root is connected to terminal nodes (leaves) [Friedman2017]_. -The library only supports stumps with two leaves. -Two methods of split criterion are available: gini and information gain. +The library only supports stumps with two leaves. +Two methods of split criterion are available: gini and information gain. See :ref:`dt_classification` for details. Batch Processing @@ -35,9 +35,12 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the training stage, a classification decision stump has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Classification Stump (Batch Processing) :widths: 20 20 60 :header-rows: 1 + :class: longtable * - Parameter - Default Value @@ -72,9 +75,12 @@ For a description of the input and output, refer to :ref:`classification_usage_m At the prediction stage, a classification stump has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Classification Stump (Batch Processing) :widths: 20 20 60 :header-rows: 1 + :class: longtable * - Parameter - Default Value @@ -91,8 +97,8 @@ At the prediction stage, a classification stump has the following parameters: * - ``resultsToEvaluate`` - ``classifier::computeClassLabels`` - The form of computed result: - - - ``classifier::computeClassLabels`` – the result contains the ``NumericTable`` + + - ``classifier::computeClassLabels`` – the result contains the ``NumericTable`` of size :math:`n \times 1` with predicted labels - ``classifier::computeClassProbabilities`` – the result contains the ``NumericTable`` @@ -111,11 +117,11 @@ Examples - :cpp_example:`stump_cls_infogain_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + - :java_example:`StumpClsGiniDenseBatch.java ` - :java_example:`StumpClsInfogainDenseBatch.java ` diff --git a/docs/source/daal/algorithms/stump/regression.rst b/docs/source/daal/algorithms/stump/regression.rst index 8bb63ca8232..cfc2e2ed6bb 100644 --- a/docs/source/daal/algorithms/stump/regression.rst +++ b/docs/source/daal/algorithms/stump/regression.rst @@ -35,9 +35,12 @@ For a description of the input and output, refer to :ref:`regression_usage_model At the training stage, a regression decision stump has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Regression Stump (Batch Processing) :widths: 20 20 60 :header-rows: 1 + :class: longtable * - Parameter - Default Value @@ -59,9 +62,12 @@ For a description of the input and output, refer to :ref:`regression_usage_model At the prediction stage, a regression stump has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for Regression Stump (Batch Processing) :widths: 20 20 60 :header-rows: 1 + :class: longtable * - Parameter - Default Value @@ -85,11 +91,11 @@ Examples :cpp_example:`stump_reg_mse_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: - + :java_example:`StumpRegMseDenseBatch.java ` .. tab:: Python* diff --git a/docs/source/daal/algorithms/svd/computation-batch-online.rst b/docs/source/daal/algorithms/svd/computation-batch-online.rst index 1764a4d332d..f69ba39ca97 100644 --- a/docs/source/daal/algorithms/svd/computation-batch-online.rst +++ b/docs/source/daal/algorithms/svd/computation-batch-online.rst @@ -22,10 +22,12 @@ Online processing computation mode assumes that the data arrives in blocks :math Algorithm Input *************** -The SVD algorithm accepts the input described below. +The SVD algorithm accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input for Singular Value Decomposition (Batch and Online Processing) :header-rows: 1 :align: left :widths: 10 60 @@ -36,7 +38,7 @@ Pass the ``Input ID`` as a parameter to the methods that provide input for your - Pointer to the numeric table that represents: - For batch processing, the entire :math:`n \times p` matrix :math:`X` to be factorized. - - For online processing, the :math:`n_i \times p` submatrix of :math:`X` that represents + - For online processing, the :math:`n_i \times p` submatrix of :math:`X` that represents the current data block in the online processing mode. The input can be an object of any class derived from ``NumericTable``. @@ -47,10 +49,13 @@ Algorithm Parameters The SVD algorithm has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Singular Value Decomposition (Batch and Online Processing) :header-rows: 1 :align: left :widths: 10 20 30 + :class: longtable * - Parameter - Default Value @@ -81,18 +86,21 @@ Algorithm Output The SVD algorithm calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Output for Singular Value Decomposition (Batch and Online Processing) :header-rows: 1 :align: left :widths: 10 60 + :class: longtable * - Result ID - Result * - ``singularValues`` - - Pointer to the :math:`1 \times p` numeric table with singular values (the diagonal of the matrix :math:`\Sigma`). + - Pointer to the :math:`1 \times p` numeric table with singular values (the diagonal of the matrix :math:`\Sigma`). * - ``leftSingularMatrix`` - Pointer to the :math:`n \times p` numeric table with left singular vectors (matrix :math:`U`). - Pass ``NULL`` if left singular vectors are not required. + Pass ``NULL`` if left singular vectors are not required. * - ``rightSingularMatrix`` - Pointer to the :math:`p \times p` numeric table with right singular vectors (matrix :math:`V`). Pass ``NULL`` if right singular vectors are not required. diff --git a/docs/source/daal/algorithms/svd/computation-distributed.rst b/docs/source/daal/algorithms/svd/computation-distributed.rst index 931d6f2714f..a1aeb2d00b0 100644 --- a/docs/source/daal/algorithms/svd/computation-distributed.rst +++ b/docs/source/daal/algorithms/svd/computation-distributed.rst @@ -24,9 +24,12 @@ Algorithm Parameters The SVD algorithm in the distributed processing mode has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Algorithm Parameters for Singular Value Decomposition (Distributed Processing) :widths: 10 10 60 :header-rows: 1 + :class: longtable * - Parameter - Default Valude @@ -48,13 +51,13 @@ The SVD algorithm in the distributed processing mode has the following parameter * - ``leftSingularMatrix`` - ``requiredInPackedForm`` - Specifies whether the matrix of left singular vectors is required. Can be: - + - ``notRequired`` - the matrix is not required - ``requiredInPackedForm`` - the matrix in the packed format is required * - ``rightSingularMatrix`` - ``requiredInPackedForm`` - Specifies whether the matrix of right singular vectors is required. Can be: - + - ``notRequired`` - the matrix is not required - ``requiredInPackedForm`` - the matrix in the packed format is required @@ -66,14 +69,19 @@ Use the three-step computation schema to compute SVD: Step 1 - on Local Nodes *********************** -.. image:: images/svd-distributed-step-1.png +.. figure:: images/svd-distributed-step-1.png :width: 800 + :alt: + + Singular Value Decomposition: Distributed Processing, Step 1 - on Local Nodes In this step, SVD accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Singular Value Decomposition (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 @@ -81,7 +89,7 @@ For more details, see :ref:`algorithms`. - Input * - ``data`` - Pointer to the :math:`n_i \times p` numeric table that represents the :math:`i`-th data block on the local node. - + .. note:: The input can be an object of any class derived from ``NumericTable``. @@ -89,20 +97,23 @@ In this step, SVD calculates the results described below. Pass the ``Partial Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for Singular Value Decomposition (Distributed Processing, Step 1) :widths: 10 60 :header-rows: 1 + :class: longtable * - Partial Result ID - Result * - ``outputOfStep1ForStep2`` - - A collection that contains numeric tables each with the partial result to transmit to the master node for :ref:`Step 2 `. + - A collection that contains numeric tables each with the partial result to transmit to the master node for :ref:`Step 2 `. * - ``outputOfStep1ForStep3`` - A collection that contains numeric tables each with the partial result to keep on the local node for :ref:`Step 3 `. .. note:: - By default, the tables in these collections are objects of the ``HomogenNumericTable`` class, + By default, the tables in these collections are objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -111,16 +122,22 @@ For more details, see :ref:`algorithms`. Step 2 - on Master Node *********************** -.. image:: images/svd-distributed-step-2.png +.. figure:: images/svd-distributed-step-2.png :width: 800 + :alt: + + Singular Value Decomposition: Distributed Processing, Step 2 - on Master Node In this step, SVD accepts the input from each local node described below. Pass the ```Input ID``` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Singular Value Decomposition (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -132,7 +149,7 @@ For more details, see :ref:`algorithms`. except the ``PackedSymmetricMatrix`` class and ``PackedTriangularMatrix`` class with the ``lowerPackedTriangularMatrix`` layout. * - ``key`` - A key, a number of type ``int``. - + Keys enable tracking the order in which partial results from :ref:`Step 1 ` (``inputOfStep2FromStep1``) come to the master node, so that the partial results computed in :ref:`Step 2 ` (``outputOfStep2ForStep3``) can be delivered back to local nodes in exactly the same order. @@ -141,7 +158,9 @@ In this step, SVD calculates the results described below. Pass the ``Partial Result ID`` or ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Partial Results for Singular Value Decomposition (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 @@ -149,33 +168,36 @@ For more details, see :ref:`algorithms`. - Result * - ``outputOfStep2ForStep3`` - A collection that contains numeric tables to be split across local nodes to compute left singular vectors. - Set to ``NULL`` if you do not need left singular vectors. + Set to ``NULL`` if you do not need left singular vectors. .. note:: - + By default, these tables are objects of the ``HomogenNumericTable`` class, but you can define them as objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Singular Value Decomposition (Distributed Processing, Step 2) :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``singularValues`` - - Pointer to the :math:`1 \times p` numeric table with singular values (the diagonal of the matrix :math:`\Sigma`). + - Pointer to the :math:`1 \times p` numeric table with singular values (the diagonal of the matrix :math:`\Sigma`). .. note:: - By default, this result is an object of the ``HomogenNumericTable`` class, + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. * - ``rightSingularMatrix`` - Pointer to the :math:`p \times p` numeric table with right singular vectors (matrix :math:`V`). - Pass ``NULL`` if right singular vectors are not required. + Pass ``NULL`` if right singular vectors are not required. .. note:: - By default, this result is an object of the ``HomogenNumericTable`` class, + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. @@ -184,29 +206,35 @@ For more details, see :ref:`algorithms`. Step 3 - on Local Nodes *********************** -.. image:: images/svd-distributed-step-2.png +.. figure:: images/svd-distributed-step-2.png :width: 800 + :alt: + + Singular Value Decomposition: Distributed Processing, Step 3 - on Local Nodes In this step, SVD accepts the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Input for Singular Value Decomposition (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input * - ``inputOfStep3FromStep1`` - - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``outputOfStep1ForStep3``). - + - A collection that contains results computed in :ref:`Step 1 ` on local nodes (``outputOfStep1ForStep3``). + .. note:: The collection can contain objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. * - ``inputOfStep3FromStep2`` - - A collection that contains results computed in :ref:`Step 2 ` on local nodes (``outputOfStep2ForStep3``). + - A collection that contains results computed in :ref:`Step 2 ` on local nodes (``outputOfStep2ForStep3``). - .. note:: + .. note:: The collection can contain objects of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. @@ -214,18 +242,20 @@ In this step, SVD calculates the results described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Singular Value Decomposition (Distributed Processing, Step 3) :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``leftSingularMatrix`` - - Pointer to the :math:`n \times p` numeric table with left singular vectors (matrix :math:`U`). - Pass ``NULL`` if left singular vectors are not required. - + - Pointer to the :math:`n \times p` numeric table with left singular vectors (matrix :math:`U`). + Pass ``NULL`` if left singular vectors are not required. + .. note:: - - By default, this result is an object of the ``HomogenNumericTable`` class, + + By default, this result is an object of the ``HomogenNumericTable`` class, but you can define the result as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/algorithms/svd/singular-value-decomposition.rst b/docs/source/daal/algorithms/svd/singular-value-decomposition.rst index 70b91b33023..a5217c45c06 100644 --- a/docs/source/daal/algorithms/svd/singular-value-decomposition.rst +++ b/docs/source/daal/algorithms/svd/singular-value-decomposition.rst @@ -35,11 +35,11 @@ Details Given the matrix :math:`X` of size :math:`n \times p`, the problem is to compute the Singular Value Decomposition (SVD) :math:`X = U \Sigma V^t`, where: - - :math:`U` is an orthogonal matrix of size :math:`n \times n` +- :math:`U` is an orthogonal matrix of size :math:`n \times n` - - :math:`\Sigma` is a rectangular diagonal matrix of size :math:`n \times p` with non-negative values on the diagonal, called singular values +- :math:`\Sigma` is a rectangular diagonal matrix of size :math:`n \times p` with non-negative values on the diagonal, called singular values - - :math:`V_t` is an orthogonal matrix of size :math:`p \times p` +- :math:`V_t` is an orthogonal matrix of size :math:`p \times p` Columns of the matrices :math:`U` and :math:`V` are called left and right singular vectors, respectively. @@ -50,7 +50,7 @@ The following computation modes are available: .. toctree:: :maxdepth: 1 - + computation-batch-online.rst computation-distributed.rst @@ -74,7 +74,7 @@ Examples - :cpp_example:`svd_dense_distr.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: @@ -82,7 +82,7 @@ Examples - :java_example:`SVDDenseBatch.java ` Online Processing: - + - :java_example:`SVDDenseOnline.java ` Distributed Processing: @@ -130,9 +130,9 @@ Distributed Processing ---------------------- Using SVD in the distributed processing mode requires gathering local-node :math:`p \times p` numeric tables on the master node. -When the amount of local-node work is small, that is, when the local-node data set is small, +When the amount of local-node work is small, that is, when the local-node data set is small, the network data transfer may become a bottleneck. -To avoid this situation, ensure that local nodes have a sufficient amount of work. +To avoid this situation, ensure that local nodes have a sufficient amount of work. For example, distribute input data set across a smaller number of nodes. .. include:: ../../../opt-notice.rst \ No newline at end of file diff --git a/docs/source/daal/algorithms/svm/support-vector-machine-classifier.rst b/docs/source/daal/algorithms/svm/support-vector-machine-classifier.rst index ddaace1cd75..ebf0741dcf2 100644 --- a/docs/source/daal/algorithms/svm/support-vector-machine-classifier.rst +++ b/docs/source/daal/algorithms/svm/support-vector-machine-classifier.rst @@ -69,13 +69,13 @@ Working subset of α updated on each iteration of the algorithm is based on the Working Set Selection (WSS) 3 scheme [Fan05]_. The scheme can be optimized using one of these techniques or both: - - **Cache**: - the implementation can allocate a predefined amount of memory - to store intermediate results of the kernel computation. +- **Cache**: + the implementation can allocate a predefined amount of memory + to store intermediate results of the kernel computation. - - **Shrinking**: - the implementation can try to decrease the amount of kernel - related computations (see [Joachims99]_). +- **Shrinking**: + the implementation can try to decrease the amount of kernel + related computations (see [Joachims99]_). The solution of the problem defines the separating hyperplane and corresponding decision function :math:`D(x)= \sum_{k} {y_k \alpha_k K(x_k, x)} + b` where only those :math:`x_k` that @@ -109,7 +109,7 @@ complete the following steps: - Use ``setBias`` to add a bias term to the model. - Use the ``getModel`` method to get the trained SVM Classifier model. -- Use the ``getStatus`` method to check the status of the model building process. +- Use the ``getStatus`` method to check the status of the model building process. If ``DAAL_NOTHROW_EXCEPTIONS`` macros is defined, the status report contains the list of errors that describe the problems API encountered (in case of API runtime failure). @@ -124,15 +124,15 @@ Examples .. tabs:: .. tab:: C++ (CPU) - + - :cpp_example:`svm_two_class_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - :java_example:`SVMTwoClassModelBuilder.java ` - + .. tab:: Python* - :daal4py_example:`svm_two_class_model_builder.py` @@ -151,10 +151,13 @@ Training and Prediction. At the training stage, SVM classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Training Parameters for Support Vector Machine Classifier (Batch Processing) :header-rows: 1 :widths: 20 30 60 :align: left + :class: longtable * - Parameter - Default Value @@ -168,12 +171,12 @@ At the training stage, SVM classifier has the following parameters: For CPU: - - ``defaultDense`` – Boser method [Boser92]_ - - ``thunder`` - Thunder method [Wen2018]_ + - ``defaultDense`` – Boser method [Boser92]_ + - ``thunder`` - Thunder method [Wen2018]_ For GPU: - - ``thunder`` - Thunder method [Wen2018]_ + - ``thunder`` - Thunder method [Wen2018]_ * - ``nClasses`` - :math:`2` @@ -212,10 +215,13 @@ Training and Prediction. At the prediction stage, SVM classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.2}|\Y{0.6}| + +.. list-table:: Prediction Parameters for Support Vector Machine Classifier (Batch Processing) :header-rows: 1 :widths: 20 30 60 :align: left + :class: longtable * - Parameter - Default Value @@ -241,18 +247,18 @@ Examples .. tab:: oneAPI DPC++ Batch Processing: - + - :ref:`dpc_svm_two_class_thunder_dense_batch.cpp` .. tab:: oneAPI C++ Batch Processing: - + - :ref:`cpp_svm_two_class_smo_dense_batch.cpp` - :ref:`cpp_svm_two_class_thunder_dense_batch.cpp` .. tab:: C++ (CPU) - + Batch Processing: - :cpp_example:`svm_two_class_boser_dense_batch.cpp ` @@ -261,9 +267,9 @@ Examples - :cpp_example:`svm_two_class_thunder_csr_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. - + Batch Processing: - :java_example:`SVMTwoClassBoserDenseBatch.java ` diff --git a/docs/source/daal/algorithms/svm_multi_class/multi-class-classifier.rst b/docs/source/daal/algorithms/svm_multi_class/multi-class-classifier.rst index 5bbc72c6f80..659ec0a13cc 100644 --- a/docs/source/daal/algorithms/svm_multi_class/multi-class-classifier.rst +++ b/docs/source/daal/algorithms/svm_multi_class/multi-class-classifier.rst @@ -107,7 +107,7 @@ Examples - :cpp_example:`svm_multi_class_model_builder.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing @@ -129,10 +129,13 @@ Training At the training stage, a multi-class classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.25}|\Y{0.3}|\Y{0.45}| + +.. list-table:: Training Parameters for Multi-class Classifier (Batch Processing) :widths: 10 20 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Default Value @@ -157,10 +160,13 @@ Prediction At the prediction stage, a multi-class classifier has the following parameters: -.. list-table:: +.. tabularcolumns:: |\Y{0.15}|\Y{0.15}|\Y{0.15}|\Y{0.55}| + +.. list-table:: Prediction Parameters for Multi-class Classifier (Batch Processing) :widths: 10 10 10 30 :header-rows: 1 :align: left + :class: longtable * - Parameter - Method @@ -203,8 +209,8 @@ At the prediction stage, a multi-class classifier has the following parameters: - ``voteBased`` - ``computeClassLabels`` - The 64-bit integer flag that specifies which extra characteristics of the decision function to compute. - - Provide one of the following values to request a single characteristic + + Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics: - ``computeClassLabels`` for `prediction` @@ -217,7 +223,9 @@ In addition to classifier output, multiclass classifier calculates the result de Pass the ``Result ID`` as a parameter to the methods that access the result of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Output for Multi-class Classifier (Batch Processing) :widths: 10 60 :header-rows: 1 :align: left @@ -252,7 +260,7 @@ Examples - :cpp_example:`svm_multi_class_thunder_dense_batch.cpp ` .. tab:: Java* - + .. note:: There is no support for Java on GPU. Batch Processing: diff --git a/docs/source/daal/cpu-vs-gpu.rst b/docs/source/daal/cpu-vs-gpu.rst index 88880ec15c5..fc38d47b1cb 100644 --- a/docs/source/daal/cpu-vs-gpu.rst +++ b/docs/source/daal/cpu-vs-gpu.rst @@ -27,12 +27,14 @@ Computation modes For the following algorithms, only listed computation modes are supported on GPU: -.. list-table:: +.. tabularcolumns:: |\Y{0.5}|\Y{0.5}| + +.. list-table:: GPU Support: Computaion Modes :header-rows: 1 :widths: 10 10 :align: left - * - Algortihm + * - Algorithm - Supported on GPU * - :ref:`dbscan` - :ref:`batch ` @@ -46,10 +48,13 @@ Methods For the following algorithms, only listed methods are supported on GPU: -.. list-table:: +.. tabularcolumns:: |\Y{0.5}|\Y{0.5}| + +.. list-table:: GPU Support: Methods :header-rows: 1 :widths: 10 10 :align: left + :class: longtable * - Algortihm - Supported on GPU @@ -77,10 +82,13 @@ For the following algorithms, only listed methods are supported on GPU: Parameters ********** -.. list-table:: +.. tabularcolumns:: |\Y{0.5}|\Y{0.5}| + +.. list-table:: GPU Support: Algorithm Parameters :header-rows: 1 :widths: 10 10 :align: left + :class: longtable * - Algortihm - Notes diff --git a/docs/source/daal/data-management/data-compression.rst b/docs/source/daal/data-management/data-compression.rst index 2aea1ac08c0..64f4c34f584 100644 --- a/docs/source/daal/data-management/data-compression.rst +++ b/docs/source/daal/data-management/data-compression.rst @@ -34,8 +34,11 @@ general methods for data compression and decompression. The following diagram illustrates the compression and decompression flow at a high level: -.. image:: ./images/compression-flow.png +.. figure:: ./images/compression-flow.png :width: 600 + :alt: + + Data Compression and Decompression Flow To define compression or decompression methods and related parameters, provide Compressor or Decompressor objects as diff --git a/docs/source/daal/data-management/data-management.rst b/docs/source/daal/data-management/data-management.rst index d088cf451bb..6553917973f 100644 --- a/docs/source/daal/data-management/data-management.rst +++ b/docs/source/daal/data-management/data-management.rst @@ -58,8 +58,9 @@ a set of Observations of size n. |short_name| defines a tabular view of a data set where table rows represent observations and columns represent features. -.. image:: ./images/data-set.png +.. figure:: ./images/data-set.png :width: 400 + :alt: Dataset An observation corresponds to a particular measurement of an observed object, and therefore when measurements are done, at distinct moments diff --git a/docs/source/daal/data-management/data-model.rst b/docs/source/daal/data-management/data-model.rst index 41713136fc2..354eefb9c66 100644 --- a/docs/source/daal/data-management/data-model.rst +++ b/docs/source/daal/data-management/data-model.rst @@ -17,7 +17,7 @@ Data Model ========== -The Data Model component of the |full_name| (|short_name|) +The Data Model component of the |full_name| (|short_name|) provides classes for model representation. The model mimics the actual data and represents it in a compact way so that you can use the library when the actual data is missing, diff --git a/docs/source/daal/data-management/data-serialization-and-deserialization.rst b/docs/source/daal/data-management/data-serialization-and-deserialization.rst index 81645552bde..c6fb24efcde 100644 --- a/docs/source/daal/data-management/data-serialization-and-deserialization.rst +++ b/docs/source/daal/data-management/data-serialization-and-deserialization.rst @@ -34,8 +34,13 @@ compression and decompression, see :ref:`data_compression`. A general structure of an archive is as follows: -.. image:: ./images/data-archive-structure.png +.. figure:: ./images/data-archive-structure.png :width: 400 + :alt: The first segment contains the archive header, + the last segment contains the archive footer, and all + other segments contain a segment header and a segment footer. + + Data Archive Structure Headers and footers contain information required to reconstruct the archived object. diff --git a/docs/source/daal/data-management/data-sources.rst b/docs/source/daal/data-management/data-sources.rst index b5def758d56..81178e1473b 100644 --- a/docs/source/daal/data-management/data-sources.rst +++ b/docs/source/daal/data-management/data-sources.rst @@ -51,18 +51,18 @@ the getNumberOfColumns() method. To retrieve the number of rows getNumberOfAvailableRows() method. The getStatus() method returns the current status of the data source: -- +- readyForLoad - the data is available for the load operation. -- +- waitingForData - the data source is waiting for new data to arrive later; designated for data sources that deal with asynchronous data streaming, that is, the data arriving in blocks at different points in time. -- +- endOfData- all the data is already loaded. @@ -83,22 +83,25 @@ collection associated with the corresponding feature in the data source. In the case you have several data sets with same data structure and you want to use continuous indexing, do the following: -#. +#. Retrieve the data dictionary from the last data source using the getDictionary() method. -#. +#. Assign this dictionary to the next data source using the setDictionary() method. -#. +#. Repeat these steps for each next data source. -.. image:: ./images/data-source.png +.. figure:: ./images/data-source.png :width: 600 + :alt: + + Reading from a Data Source |short_name| implements classes for some popular types of data sources. Each of these classes takes a feature manager class as the @@ -210,8 +213,8 @@ table. In general case, feature modifier is able to process arbitrary number of input features to arbitrary number of output features. Let's assume that we added m modifiers along with the features subsets :math:`F_1, \ldots, F_m` and the :math:`j`-th modifier has the -:math:`C_j` output columns, where :math:`F_j = (f_{i_1}^j, \ldots, f_{i_{n_j}}^j)` -are specified input features of interest, :math:`f_i^j \in \{f_1, \ldots, f_p\}`, +:math:`C_j` output columns, where :math:`F_j = (f_{i_1}^j, \ldots, f_{i_{n_j}}^j)` +are specified input features of interest, :math:`f_i^j \in \{f_1, \ldots, f_p\}`, :math:`f_1, \ldots, f_p` are all possible features, :math:`p` is the number of features in the input data. The output numeric table will contain :math:`C_1 + C_2 + \ldots + C_m` columns. The :math:`j`-th feature modifier writes result to @@ -225,9 +228,12 @@ columns 1, 2 in the output numeric table. *Feature Modifier 2* behaves similarly, but processes features :math:`f_2, f_5` and has 3 output features. -.. image:: ./images/data-source-2.png +.. figure:: ./images/data-source-2.png :width: 600 - + :alt: + + Feature Modifiers + The |short_name| has several predefined feature modifiers available for CSV and SQL feature managers. @@ -252,20 +258,20 @@ of user-defined feature modifier is shown in the code block bellow: :: - class MyFeatureModifier : public modifiers::csv::FeatureModifierBase + class MyFeatureModifier : public modifiers::csv::FeatureModifierBase { public: virtual void initialize(modifiers::csv::Config &config); virtual void apply(modifiers::csv::Context &context); virtual void finalize(modifiers::csv::Config &config); - }; + }; Use the addModifier(…) method to add the user-defined modifier to the feature manager: :: - ds.getFeatureManager().addModifier( + ds.getFeatureManager().addModifier( features::list(0, 3), modifiers::custom() ); diff --git a/docs/source/daal/data-management/generic-interfaces.rst b/docs/source/daal/data-management/generic-interfaces.rst index 0ff9102f800..9d2c3400817 100644 --- a/docs/source/daal/data-management/generic-interfaces.rst +++ b/docs/source/daal/data-management/generic-interfaces.rst @@ -34,8 +34,11 @@ these steps applies to different types of numeric tables supported in the library, such as CSR, with appropriate changes in the method names and respective arguments. -.. image:: images/numeric-table-lifecycle.png +.. figure:: images/numeric-table-lifecycle.png :width: 400 + :alt: + + Numeric Table Lifecycle Initialize ********** @@ -93,7 +96,7 @@ are available for use of constructors: To allocate or reallocate the memory after construction of the numeric table, use service methods: -- resize(). +- ``resize()`` This method modifies the number of rows in the table according to the provided parameter and operates according to the description below: @@ -118,10 +121,10 @@ After initialization or re-initialization of a numeric table, you can use the following methods for the numeric table to access the data: -- getBlockOfRows() and releaseBlockOfRows(). +- ``getBlockOfRows()`` and ``releaseBlockOfRows()`` - The getBlockOfRows() method provides access to a data block - stored in the numeric table. The rwflag argument specifies read + The ``getBlockOfRows()`` method provides access to a data block + stored in the numeric table. The ``rwflag`` argument specifies read or write access. Provide the object of the BlockDescriptor type to the method to interface the requested block of rows. This object, the block descriptor, represents the data in the @@ -134,18 +137,18 @@ data: data with the float data type, while the block descriptor represents the requested data in double. You can specify the required data type during the construction of the block - descriptor object. Make sure to call the releaseBlockOfRows() - method after a call to getBlockOfRows(). The data types of the + descriptor object. Make sure to call the ``releaseBlockOfRows()`` + method after a call to ``getBlockOfRows()``. The data types of the numeric table and block descriptor, as well as the rwflag - argument of the getBlockOfRows() method, define the behavior of releaseBlockOfRows(): + argument of the ``getBlockOfRows()`` method, define the behavior of ``releaseBlockOfRows()``: - - If rwflag is set to writeOnly or readWrite, - releaseBlockOfRows() writes the data from the block + - If ``rwflag`` is set to ``writeOnly`` or ``readWrite``, + ``releaseBlockOfRows()`` writes the data from the block descriptor back to the numeric table. - If the numeric table and block descriptor use different data - types or memory layouts, releaseBlockOfRows() deallocates - the allocated buffers regardless of the value of rwflag. + types or memory layouts, ``releaseBlockOfRows()`` deallocates + the allocated buffers regardless of the value of ``rwflag``. :: @@ -163,37 +166,37 @@ data: } table.releaseBlockOfRows(block); - - getBlockOfColumnValues() and releaseBlockOfColumnValues(). + - ``getBlockOfColumnValues()`` and ``releaseBlockOfColumnValues()`` These methods provide access to values in the specific column - of a numeric table, similarly to getBlockOfRows() and releaseBlockOfRows(). + of a numeric table, similarly to ``getBlockOfRows()`` and ``releaseBlockOfRows()``. - - getNumberOfRows() and getNumberOfColumns(). + - ``getNumberOfRows()`` and ``getNumberOfColumns()`` Call these methods to determine the number of rows and columns, respectively, associated with a given numeric table. - - getDictionary() and resetDictionary(), as well as - getFeatureType() and getNumberOfCategories(). + - ``getDictionary()`` and ``resetDictionary()``, as well as + ``getFeatureType()`` and ``getNumberOfCategories()``. These methods provide access to the data dictionary associated with a given numeric table. See Data Dictionaries for more details. - - getDataMemoryStatus(). + - ``getDataMemoryStatus()`` Call this method to determine whether the memory is allocated - by the allocateDataMemory() method, a user provided a pointer + by the ``allocateDataMemory()`` method, a user provided a pointer to the allocated data, or no data is currently associated with - the numeric table. Additionally, the getArray() method is - complimentary to setArray() and provides access to the data + the numeric table. Additionally, the ``getArray()`` method is + complimentary to ``setArray()`` and provides access to the data associated with a given table of a given layout. - - serialize and deserialize(). + - ``serialize()`` and ``deserialize()`` - The serialize() method enables you to serialize the numeric - table. Call the deserialization method deserialize() after each - call to serialize(), but before a call to other data access + The ``serialize()`` method enables you to serialize the numeric + table. Call the deserialization method ``deserialize()`` after each + call to ``serialize()``, but before a call to other data access methods. Deinitialize diff --git a/docs/source/daal/data-management/numeric-tables-types.rst b/docs/source/daal/data-management/numeric-tables-types.rst index 7a69506dbfa..ea86bad0649 100644 --- a/docs/source/daal/data-management/numeric-tables-types.rst +++ b/docs/source/daal/data-management/numeric-tables-types.rst @@ -20,7 +20,7 @@ Types of Numeric Tables .. include:: ./numeric-tables/heterogen-numeric-tables.rst .. include:: ./numeric-tables/homogen-numeric-tables.rst - + .. include:: ./numeric-tables/csr-numeric-table.rst .. include:: ./numeric-tables/merged-numeric-table.rst diff --git a/docs/source/daal/data-management/numeric-tables/csr-numeric-table.rst b/docs/source/daal/data-management/numeric-tables/csr-numeric-table.rst index 4e82a21aba9..78183f20038 100644 --- a/docs/source/daal/data-management/numeric-tables/csr-numeric-table.rst +++ b/docs/source/daal/data-management/numeric-tables/csr-numeric-table.rst @@ -26,11 +26,17 @@ of a homogeneous numeric table that encodes sparse data, that is, the data with a significant number of zero elements. The library uses the Condensed Sparse Row (CSR) format for encoding: -.. image:: ./images/zero-based-csr.png +.. figure:: ./images/zero-based-csr.png :width: 600 + :alt: -.. image:: ./images/one-based-csr.png + Condensed Sparse Row (CSR) 0-Based Encoding + +.. figure:: ./images/one-based-csr.png :width: 600 + :alt: + + Condensed Sparse Row (CSR) 1-Based Encoding Three arrays describe the sparse matrix M as follows: diff --git a/docs/source/daal/data-management/numeric-tables/heterogen-numeric-tables.rst b/docs/source/daal/data-management/numeric-tables/heterogen-numeric-tables.rst index 7ab1be12434..38e89fb4499 100644 --- a/docs/source/daal/data-management/numeric-tables/heterogen-numeric-tables.rst +++ b/docs/source/daal/data-management/numeric-tables/heterogen-numeric-tables.rst @@ -33,8 +33,11 @@ AOS Numeric Table AOS Numeric Table provides access to observations (feature vectors) that are laid out in a contiguous memory block: -.. image:: ./images/aos-layout.png +.. figure:: ./images/aos-layout.png :width: 600 + :alt: + + Array-Of-Structures (AOS) Memory Layout Examples -------- @@ -53,8 +56,11 @@ SOA Numeric Table SOA Numeric Table provides access to data sets where observations for each feature are laid out contiguously in memory: -.. image:: ./images/soa-layout.png +.. figure:: ./images/soa-layout.png :width: 600 + :alt: + + Structure-Of-Arrays (SOA) Memory Layout Examples -------- diff --git a/docs/source/daal/data-management/numeric-tables/homogen-numeric-tables.rst b/docs/source/daal/data-management/numeric-tables/homogen-numeric-tables.rst index 28e5a2c50a1..0ececb38d38 100644 --- a/docs/source/daal/data-management/numeric-tables/homogen-numeric-tables.rst +++ b/docs/source/daal/data-management/numeric-tables/homogen-numeric-tables.rst @@ -40,5 +40,8 @@ between representations of triangular and symmetric matrices: - Lower packed: ``lowerPackedSymetricMatrix`` or ``lowerPackedTriangularMatrix`` - Upper packed: ``upperPackedTriangularMatrix`` or ``upperPackedSymetricMatrix`` -.. image:: ./images/packed-storage-format.png +.. figure:: ./images/packed-storage-format.png :width: 600 + :alt: + + Packed Storage Format for Symmetric and Triangular Matrices diff --git a/docs/source/daal/data-management/numeric-tables/merged-numeric-table.rst b/docs/source/daal/data-management/numeric-tables/merged-numeric-table.rst index a0f8439f7cf..fe0bdc95a10 100644 --- a/docs/source/daal/data-management/numeric-tables/merged-numeric-table.rst +++ b/docs/source/daal/data-management/numeric-tables/merged-numeric-table.rst @@ -33,8 +33,11 @@ matrices, the number of rows in a merged table equals :math:`min(r_1, r_2, \ldot where :math:`r_i` is the number of rows in the i-th matrix, :math:`i = 1, 2, 3, \ldots, m`. -.. image:: ./images/merged-numeric-table.png +.. figure:: ./images/merged-numeric-table.png :width: 400 + :alt: + + Merged Numeric Table Examples ******** diff --git a/docs/source/daal/includes/default_result_data_collection.rst b/docs/source/daal/includes/default_result_data_collection.rst index 6621ef0962c..e39765b25a0 100644 --- a/docs/source/daal/includes/default_result_data_collection.rst +++ b/docs/source/daal/includes/default_result_data_collection.rst @@ -16,6 +16,6 @@ .. note:: - By default, this result is an object of the ``DataCollection`` class. + By default, this result is an object of the ``DataCollection`` class. The numeric tables in the collection can be an object of any class derived from ``NumericTable` except for ``PackedTriangularMatrix``, ``PackedSymmetricMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/services/callback-for-host-application.rst b/docs/source/daal/services/callback-for-host-application.rst index 44e97621bd9..1b6b01888f6 100644 --- a/docs/source/daal/services/callback-for-host-application.rst +++ b/docs/source/daal/services/callback-for-host-application.rst @@ -28,10 +28,13 @@ pointer to an instance of Algorithm class. Following methods of the Algorithm class are used: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Algorithm class methods :widths: 20 60 :header-rows: 1 :align: left + :class: longtable * - Name - Description @@ -43,7 +46,9 @@ Following methods of the Algorithm class are used: HostAppIface class includes following methods: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: HostAppIface class Methods :widths: 20 60 :header-rows: 1 :align: left @@ -55,10 +60,10 @@ HostAppIface class includes following methods: Enables computation cancelling. The method is called by the owning algorithm when computation is in progress. If the method returns true then computation stops and returns - ErrorUserCancelled status. Since the method can be called from - parallel threads when running with |short_name| threaded version, it is - application responsibility to make its implementation thread-safe. It is not - recommended for this method to throw exceptions. + ErrorUserCancelled status. Since the method can be called from + parallel threads when running with |short_name| threaded version, it is + application responsibility to make its implementation thread-safe. It is not + recommended for this method to throw exceptions. Currently HostAppIface is supported in C++ only, cancelling is diff --git a/docs/source/daal/training-prediction.rst b/docs/source/daal/training-prediction.rst index 2b9b98e562b..adcf3e37b54 100644 --- a/docs/source/daal/training-prediction.rst +++ b/docs/source/daal/training-prediction.rst @@ -36,16 +36,16 @@ Training and prediction algorithms in |full_name| (|short_name|) include a range algorithms/svm_multi_class/multi-class-classifier.rst algorithms/boosting/index.rst -Unlike :ref:`analysis` algorithms, which are intended to characterize the structure of data sets, machine learning algorithms model the data. +Unlike :ref:`analysis` algorithms, which are intended to characterize the structure of data sets, machine learning algorithms model the data. Modeling operates in two major stages: - **Training**, when the algorithm estimates model parameters based on a training data set. - **Prediction or decision making**, when the algorithm uses the trained model to predict the outcome based on new data. Training is typically a lot more computationally complex problem than prediction. -Therefore, certain end-to-end analytics usage scenarios require that training and prediction phases are done on different devices, -the training is done on more powerful devices, while prediction is done on smaller devices. -Because smaller devices may have stricter memory footprint requirements, +Therefore, certain end-to-end analytics usage scenarios require that training and prediction phases are done on different devices, +the training is done on more powerful devices, while prediction is done on smaller devices. +Because smaller devices may have stricter memory footprint requirements, |short_name| separates Training, Prediction, and respective Model in three different class hierarchies to minimize the footprint. Training Alternative @@ -61,8 +61,9 @@ ready for the prediction stage. The following schema illustrates the use of Model Builder class: -.. image:: images/model_builders.png +.. figure:: images/model_builders.png :width: 600 + :alt: The Model Builder class is implemented for the following algorithms: diff --git a/docs/source/daal/usage/algorithms.rst b/docs/source/daal/usage/algorithms.rst index 87fe22bf489..23074cbd52e 100644 --- a/docs/source/daal/usage/algorithms.rst +++ b/docs/source/daal/usage/algorithms.rst @@ -34,12 +34,15 @@ In computation modes that permit multiple calls to the ``compute()`` method, ensure that the structure of the input data, that is, the number of features, their order, and type, is the same for all the calls. The following methods are available to provide input to an algorithm: -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Algorithm Input :widths: 10 60 :align: left + :class: longtable * - ``input.set(Input ID, InputData)`` - - Use to set a pointer to the input argument with the ``Input ID`` identifier. + - Use to set a pointer to the input argument with the ``Input ID`` identifier. This method overwrites the previous input pointer stored in the algorithm. * - ``input.add(Input ID, InputData)`` - Use in the distributed computation mode to add the pointers with the ``Input ID`` identifier. diff --git a/docs/source/daal/usage/computation-modes.rst b/docs/source/daal/usage/computation-modes.rst index 52b38bd13e9..a8c0d2f8676 100644 --- a/docs/source/daal/usage/computation-modes.rst +++ b/docs/source/daal/usage/computation-modes.rst @@ -51,22 +51,26 @@ for a given data source to check whether a new block of data is available for lo The following diagram illustrates the computation schema for online processing: -.. image:: ./images/online-1.png +.. figure:: ./images/online-1.png :width: 600 + :alt: -.. image:: ./images/online-2.png +.. figure:: ./images/online-2.png :width: 600 + :alt: .. note:: - While different data blocks may have different numbers of observations :math:`n_i`, + While different data blocks may have different numbers of observations :math:`n_i`, they must have the same number of feature vectors :math:`p`. -.. image:: ./images/online-3.png +.. figure:: ./images/online-3.png :width: 600 + :alt: -.. image:: ./images/online-4.png +.. figure:: ./images/online-4.png :width: 600 + :alt: .. _distributed_mode: @@ -78,20 +82,22 @@ In distributed processing mode, the ``compute()`` and the ``finalizeCompute()`` This computation mode assumes that the data set is split in nblocks blocks across computation nodes. Computation is done in several steps. -You need to define the computation step for an algorithm by providing the computeStep value to the constructor during +You need to define the computation step for an algorithm by providing the computeStep value to the constructor during initialization of the algorithm. Use the ``compute()`` method on each computation node to compute partial results. Use the ``input.add()`` method on the master node to add pointers to partial results processed on each computation node. When the last partial result arrives, call the ``compute()`` method followed by ``finalizeCompute()`` to produce final results. -If the input data arrives in an asynchronous mode, you can use the ``getStatus()`` method for a given data source to check whether +If the input data arrives in an asynchronous mode, you can use the ``getStatus()`` method for a given data source to check whether a new block of data is available for loading. The computation schema is algorithm-specific. The following diagram illustrates a typical computation schema for distribute processing: -.. image:: ./images/distributed-1.png +.. figure:: ./images/distributed-1.png :width: 600 + :alt: -.. image:: ./images/distributed-2.png +.. figure:: ./images/distributed-2.png :width: 600 + :alt: For the algorithm-specific computation schema, refer to the Distributed Processing section in the description of an appropriate algorithm. diff --git a/docs/source/daal/usage/training-and-prediction/classification.rst b/docs/source/daal/usage/training-and-prediction/classification.rst index 91fe758ecb7..26d38e2020d 100644 --- a/docs/source/daal/usage/training-and-prediction/classification.rst +++ b/docs/source/daal/usage/training-and-prediction/classification.rst @@ -29,16 +29,22 @@ The parameters used by classification algorithms at each stage depend on a speci Training Stage ************** -.. image:: images/training-stage-classification.png +.. figure:: images/training-stage-classification.png :width: 600 + :alt: + + Classification Usage Model: Training Stage At the training stage, classification algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Classification Algorithms :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -59,7 +65,9 @@ At the training stage, classification algorithms calculate the result described Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Classification Algorithms :widths: 10 60 :header-rows: 1 @@ -71,16 +79,22 @@ For more details, see :ref:`algorithms`. Prediction Stage **************** -.. image:: images/prediction-stage-classification.png +.. figure:: images/prediction-stage-classification.png :width: 600 + :alt: + + Classification Usage Model: Prediction Stage At the prediction stage, classification algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Input for Classification Algorithms :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -95,21 +109,24 @@ At the prediction stage, classification algorithms calculate the result describe Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Output for Classification Algorithms :widths: 10 60 :header-rows: 1 + :class: longtable * - Result ID - Result * - ``prediction`` - Pointer to the :math:`n \times 1` numeric table with classification results (class labels or confidence levels). - + .. note:: - + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. - + * - ``probabilities`` - A numeric table of size :math:`n \times \text{nClasses}`, containing probabilities of classes computed when the ``computeClassProbabilities`` option is enabled. This result table is available for selected algorithms, see corresponding algorithm documentation for details. diff --git a/docs/source/daal/usage/training-and-prediction/recommendation-systems.rst b/docs/source/daal/usage/training-and-prediction/recommendation-systems.rst index cad717261b8..6c11b262df3 100644 --- a/docs/source/daal/usage/training-and-prediction/recommendation-systems.rst +++ b/docs/source/daal/usage/training-and-prediction/recommendation-systems.rst @@ -30,24 +30,29 @@ For a list of these parameters, refer to the description of an appropriate recom Training Stage ************** -.. image:: images/training-stage-recommendation-systems.png +.. figure:: images/training-stage-recommendation-systems.png :width: 600 + :alt: + + Recommendation Systems Usage Model: Training Stage At the training stage, recommender algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Recommender Algorithms :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``data`` - - Pointer to the :math:`m \times n` numeric table with the mining data. - + - Pointer to the :math:`m \times n` numeric table with the mining data. + .. note:: - + This table can be an object of any class derived from ``NumericTable`` except ``PackedTriangularMatrix`` and ``PackedSymmetricMatrix``. @@ -55,43 +60,52 @@ At the training stage, recommender algorithms calculate the result described bel Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Recommender Algorithms :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``model`` - - Model with initialized item factors. - + - Model with initialized item factors. + .. note:: The result can only be an object of the ``Model`` class. Prediction Stage **************** -.. image:: images/prediction-stage-recommendation-systems.png +.. figure:: images/prediction-stage-recommendation-systems.png :width: 600 + :alt: + + Recommendation Systems Usage Model: Prediction Stage At the prediction stage, recommender algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Input for Recommender Algorithms :widths: 10 60 :header-rows: 1 * - Input ID - Input * - ``model`` - - Model with initialized item factors. - + - Model with initialized item factors. + .. note:: This input can only be an object of the ``Model`` class. At the prediction stage, recommender algorithms calculate the result described below. Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Output for Recommender Algorithms :widths: 10 60 :header-rows: 1 @@ -99,9 +113,9 @@ For more details, see :ref:`algorithms`. - Result * - ``prediction`` - Pointer to the :math:`m \times n` numeric table with predicted ratings. - - .. note:: - + + .. note:: + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix``, ``PackedTriangularMatrix``, and ``CSRNumericTable``. diff --git a/docs/source/daal/usage/training-and-prediction/regression.rst b/docs/source/daal/usage/training-and-prediction/regression.rst index 69e0c8f981e..29c9527e090 100644 --- a/docs/source/daal/usage/training-and-prediction/regression.rst +++ b/docs/source/daal/usage/training-and-prediction/regression.rst @@ -30,16 +30,22 @@ For a list of these parameters, refer to the description of an appropriate regre Training Stage ************** -.. image:: images/training-stage-regression.png +.. figure:: images/training-stage-regression.png :width: 600 + :alt: -At the training stage, regression algorithms accept the input described below. + Regression Usage Model: Training Stage + +At the training stage, regression algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Input for Regression Algorithms :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -58,7 +64,9 @@ At the training stage, regression algorithms calculate the result described belo Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Training Output for Regression Algorithms :widths: 10 60 :header-rows: 1 @@ -70,16 +78,22 @@ For more details, see :ref:`algorithms`. Prediction Stage **************** -.. image:: images/prediction-stage-regression.png +.. figure:: images/prediction-stage-regression.png :width: 600 + :alt: + + Regression Usage Model: Prediction Stage At the prediction stage, regression algorithms accept the input described below. Pass the ``Input ID`` as a parameter to the methods that provide input for your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Input for Regression Algorithms :widths: 10 60 :header-rows: 1 + :class: longtable * - Input ID - Input @@ -94,15 +108,17 @@ At the prediction stage, regression algorithms calculate the result described be Pass the ``Result ID`` as a parameter to the methods that access the results of your algorithm. For more details, see :ref:`algorithms`. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Prediction Output for Regression Algorithms :widths: 10 60 :header-rows: 1 * - Result ID - Result * - ``prediction`` - - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables). - + - Pointer to the :math:`n \times k` numeric table with responses (:math:`k` dependent variables). + By default, this table is an object of the ``HomogenNumericTable`` class, but you can define it as an object of any class derived from ``NumericTable`` except ``PackedSymmetricMatrix`` and ``PackedTriangularMatrix``. diff --git a/docs/source/data-analytics-pipeline.rst b/docs/source/data-analytics-pipeline.rst index a0270d21d2b..fd92202a218 100644 --- a/docs/source/data-analytics-pipeline.rst +++ b/docs/source/data-analytics-pipeline.rst @@ -24,7 +24,7 @@ blocks covering all stages of data analytics: data acquisition from a data source, preprocessing, transformation, data mining, modeling, validation, and decision making. -.. image:: _static/data_analytics_stages.png +.. figure:: _static/data_analytics_stages.png :width: 800 :alt: Data analytics stages @@ -36,6 +36,6 @@ Interfaces (APIs) are agnostic about a particular cross-device communication technology and, therefore, can be used within different end-to-end analytics frameworks. -.. image:: _static/e2eframeworks.png +.. figure:: _static/e2eframeworks.png :width: 800 :alt: End to End Analytics Frameworks \ No newline at end of file diff --git a/docs/source/examples.rst b/docs/source/examples.rst index f9192c07f61..24ccdeec96d 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -22,6 +22,6 @@ oneAPI Examples .. toctree:: :maxdepth: 2 :glob: - + DPC++ C++ diff --git a/docs/source/includes/clustering/kmeans-examples.rst b/docs/source/includes/clustering/kmeans-examples.rst index 5edf86626c5..df3a693454f 100644 --- a/docs/source/includes/clustering/kmeans-examples.rst +++ b/docs/source/includes/clustering/kmeans-examples.rst @@ -14,7 +14,7 @@ .. * limitations under the License. .. *******************************************************************************/ -.. tabs:: +.. tabs:: .. group-tab:: oneAPI DPC++ diff --git a/docs/source/includes/clustering/kmeans-init-examples.rst b/docs/source/includes/clustering/kmeans-init-examples.rst index b97a65b4c8f..d28ea5a5d85 100644 --- a/docs/source/includes/clustering/kmeans-init-examples.rst +++ b/docs/source/includes/clustering/kmeans-init-examples.rst @@ -14,7 +14,7 @@ .. * limitations under the License. .. *******************************************************************************/ -.. tabs:: +.. tabs:: .. group-tab:: oneAPI DPC++ diff --git a/docs/source/includes/ensembles/df-classification-examples.rst b/docs/source/includes/ensembles/df-classification-examples.rst index a29717df592..a76120a8a2f 100644 --- a/docs/source/includes/ensembles/df-classification-examples.rst +++ b/docs/source/includes/ensembles/df-classification-examples.rst @@ -17,13 +17,13 @@ .. tabs:: .. group-tab:: oneAPI DPC++ - + Batch Processing: - + - :ref:`dpc_df_cls_hist_batch.cpp` - + .. group-tab:: oneAPI C++ - + Batch Processing: - + - :ref:`cpp_df_cls_dense_batch.cpp` \ No newline at end of file diff --git a/docs/source/includes/ensembles/df-introduction.rst b/docs/source/includes/ensembles/df-introduction.rst index dd30a88d57b..5272cba2999 100644 --- a/docs/source/includes/ensembles/df-introduction.rst +++ b/docs/source/includes/ensembles/df-introduction.rst @@ -15,8 +15,8 @@ .. *******************************************************************************/ -Decision Forest (DF) :capterm:`classification` and :capterm:`regression` algorithms are based on an ensemble of -tree-structured classifiers, which are known as :ref:`decision trees
`. Decision forest is built +Decision Forest (DF) :capterm:`classification` and :capterm:`regression` algorithms are based on an ensemble of +tree-structured classifiers, which are known as :ref:`decision trees
`. Decision forest is built using the general technique of bagging, a bootstrap aggregation, and a random choice of features. For more details, see [Breiman84]_ and [Breiman2001]_. diff --git a/docs/source/includes/ensembles/df-regression-examples.rst b/docs/source/includes/ensembles/df-regression-examples.rst index b42a7d82eb7..460aaa3f8f5 100644 --- a/docs/source/includes/ensembles/df-regression-examples.rst +++ b/docs/source/includes/ensembles/df-regression-examples.rst @@ -17,13 +17,13 @@ .. tabs:: .. group-tab:: oneAPI DPC++ - + Batch Processing: - + - :ref:`dpc_df_reg_hist_batch.cpp` - + .. group-tab:: oneAPI C++ - + Batch Processing: - + - :ref:`cpp_df_reg_dense_batch.cpp` \ No newline at end of file diff --git a/docs/source/includes/kernel-functions/linear-kernel-examples.rst b/docs/source/includes/kernel-functions/linear-kernel-examples.rst index 7325583a872..f678f3b0f0a 100644 --- a/docs/source/includes/kernel-functions/linear-kernel-examples.rst +++ b/docs/source/includes/kernel-functions/linear-kernel-examples.rst @@ -19,7 +19,7 @@ .. group-tab:: oneAPI DPC++ Batch Processing: - + - :ref:`dpc_linear_kernel_dense_batch.cpp` .. group-tab:: oneAPI C++ diff --git a/docs/source/includes/nearest-neighbors/knn-examples.rst b/docs/source/includes/nearest-neighbors/knn-examples.rst index 7fed2233835..a0b38508bb7 100644 --- a/docs/source/includes/nearest-neighbors/knn-examples.rst +++ b/docs/source/includes/nearest-neighbors/knn-examples.rst @@ -21,7 +21,7 @@ Batch Processing: - :ref:`dpc_knn_cls_brute_force_dense_batch.cpp` - + .. group-tab:: oneAPI C++ Batch Processing: diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 4bc13398380..471e08f10fa 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -26,7 +26,7 @@ Installation ============ -You can obtain the latest version of |short_name|: +You can obtain the latest version of |short_name|: - from |idz|_ as a part of |base_tk|. - from |github_rls|_ as a binary file. diff --git a/docs/source/notes/issues/2021.1-beta04/dll-file-not-found.rst b/docs/source/notes/issues/2021.1-beta04/dll-file-not-found.rst index 7bfcc09a438..322f17e9056 100644 --- a/docs/source/notes/issues/2021.1-beta04/dll-file-not-found.rst +++ b/docs/source/notes/issues/2021.1-beta04/dll-file-not-found.rst @@ -18,11 +18,11 @@ DLL file not found ****************** If you run your program in Visual Studio and encounter a "sycl.dll was not found" runtime error -or a similar one such as the one shown below, update the project property :guilabel:`Debugging` > :guilabel:`Environment`. +or a similar one such as the one shown below, update the project property :guilabel:`Debugging` > :guilabel:`Environment`. To do this, follow `How to Fix`_ instructions. - .. image:: images/runtime_error.png - :alt: Unable to start a program: the code execution cannot proceed because XXX.dll was not found. + .. figure:: images/runtime_error.png + :alt: Unable to start a program: the code execution cannot proceed because XXX.dll was not found. :class: with-border .. attention:: @@ -33,10 +33,10 @@ To do this, follow `How to Fix`_ instructions. How to Fix ---------- -1. Open the project's properties, go to :guilabel:`Debugging` > :guilabel:`Environment` property, +1. Open the project's properties, go to :guilabel:`Debugging` > :guilabel:`Environment` property, right-click the drop-down menu, and select :guilabel:`Edit`: - .. image:: images/vsproj_debug_step1_open.png + .. figure:: images/vsproj_debug_step1_open.png :width: 600 :alt: Changing configuration properties :class: with-border @@ -44,14 +44,14 @@ How to Fix 2. Copy the default value of the ``PATH`` environment variable from the :guilabel:`Evaluated value` section and then paste it to the section above it: - .. image:: images/vsproj_debug_step2_copy.png + .. figure:: images/vsproj_debug_step2_copy.png :width: 600 :alt: Changing configuration properties :class: with-border 3. Add to ``PATH`` the paths to the dll files that the program needs: - .. image:: images/vsproj_debug_step3_add.png + .. figure:: images/vsproj_debug_step3_add.png :width: 600 :alt: Changing configuration properties :class: with-border diff --git a/docs/source/notes/issues/2021.1-beta06/dpcpp-examples-in-vs2017.rst b/docs/source/notes/issues/2021.1-beta06/dpcpp-examples-in-vs2017.rst index e46d38812cf..07e21feaba0 100644 --- a/docs/source/notes/issues/2021.1-beta06/dpcpp-examples-in-vs2017.rst +++ b/docs/source/notes/issues/2021.1-beta06/dpcpp-examples-in-vs2017.rst @@ -21,7 +21,7 @@ DPC++ examples for |short_name| might not work in Visual Studio 2017 by default. .. code-block:: text - The Windows SDK version 10.0 was not found. Install the required version of Windows SDK or change the SDK version + The Windows SDK version 10.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".   How to Fix diff --git a/docs/source/notes/issues/2021.1-beta06/level-zero-not-found.rst b/docs/source/notes/issues/2021.1-beta06/level-zero-not-found.rst index d762f16e1dc..3b4171116ed 100644 --- a/docs/source/notes/issues/2021.1-beta06/level-zero-not-found.rst +++ b/docs/source/notes/issues/2021.1-beta06/level-zero-not-found.rst @@ -44,7 +44,7 @@ There are two ways to fix this: #define DAAL_DISABLE_LEVEL_ZERO 2. Disable Level Zero runtime: - + .. code-block:: bash - + export SYCL_BE=PI_OPENCL diff --git a/docs/source/notes/issues/2021.1-beta06/undeclared-identifier.rst b/docs/source/notes/issues/2021.1-beta06/undeclared-identifier.rst index ef5e5c0f217..6650ed760d4 100644 --- a/docs/source/notes/issues/2021.1-beta06/undeclared-identifier.rst +++ b/docs/source/notes/issues/2021.1-beta06/undeclared-identifier.rst @@ -22,7 +22,7 @@ When you build an application with |short_name|, you might encounter the followi .. code-block:: text error: use of undeclared identifier CL_DEVICE_IL_VERSION_KHR - + This is caused by a bug in |dpcpp| 2021.1-beta06 release. How to fix diff --git a/docs/source/notes/issues/2021.1-beta08/windows-static-debug-config.rst b/docs/source/notes/issues/2021.1-beta08/windows-static-debug-config.rst index ed8c57e23e0..6318357b48d 100644 --- a/docs/source/notes/issues/2021.1-beta08/windows-static-debug-config.rst +++ b/docs/source/notes/issues/2021.1-beta08/windows-static-debug-config.rst @@ -17,7 +17,7 @@ Static debug configuration not working ************************************** -On Windows*, the static debug configuration of the library does not work. +On Windows*, the static debug configuration of the library does not work. An example of the error you will see: .. code-block:: text diff --git a/docs/source/onedal/algorithms/ensembles/decision-forest.rst b/docs/source/onedal/algorithms/ensembles/decision-forest.rst index 64bed0cc9f6..3d0edaefa4f 100644 --- a/docs/source/onedal/algorithms/ensembles/decision-forest.rst +++ b/docs/source/onedal/algorithms/ensembles/decision-forest.rst @@ -34,7 +34,7 @@ Training -------- Given :math:`n` feature vectors :math:`X=\{x_1=(x_{11},\ldots,x_{1p}),\ldots,x_n=(x_{n1},\ldots,x_{np})\}` of -size :math:`p`, their non-negative observation weights :math:`W=\{w_1,\ldots,w_n\}` and :math:`n` responses :math:`Y=\{y_1,\ldots,y_n\}`, +size :math:`p`, their non-negative observation weights :math:`W=\{w_1,\ldots,w_n\}` and :math:`n` responses :math:`Y=\{y_1,\ldots,y_n\}`, .. tabs:: @@ -44,7 +44,7 @@ size :math:`p`, their non-negative observation weights :math:`W=\{w_1,\ldots,w_n .. group-tab:: Regression - - :math:`y_i \in \mathbb{R}` + - :math:`y_i \in \mathbb{R}` the problem is to build a decision forest classification or regression model. @@ -73,7 +73,7 @@ corresponding to their children, :math:`t_L` and :math:`t_R`. Training method: *Dense* ++++++++++++++++++++++++ -In *dense* training method, all possible splits for each feature are taken from the subset of selected features for the current node and evaluated +In *dense* training method, all possible splits for each feature are taken from the subset of selected features for the current node and evaluated for best split computation. .. _df_t_math_hist: @@ -81,8 +81,8 @@ for best split computation. Training method: *Hist* +++++++++++++++++++++++ -In *hist* training method, only a selected subset of splits is considered for best split computation. -This subset of splits is computed for each feature at the initialization stage of the algorithm. +In *hist* training method, only a selected subset of splits is considered for best split computation. +This subset of splits is computed for each feature at the initialization stage of the algorithm. After computing the subset of splits, each value from the initially provided data is substituted with the value of the corresponding bin. Bins are continuous intervals between selected splits. @@ -99,38 +99,44 @@ the subset :math:`D_t` in the node :math:`t`. .. group-tab:: Classification *Gini index* is an impurity metric for classification, calculated as follows: - + .. math:: {I}_{Gini}\left(D\right)=1-\sum _{i=0}^{C-1}{p}_{i}^{2} - - where - + + where + - :math:`D` is a set of observations that reach the node; - :math:`p_i` is specified in the table below: - - .. list-table:: + + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: Decision Forest Split Criteria Calculation :widths: 10 10 :header-rows: 1 :align: left - + :class: longtable + * - Without sample weights - With sample weights * - :math:`p_i` is the observed fraction of observations that belong to class :math:`i` in :math:`D` - :math:`p_i` is the observed weighted fraction of observations that belong to class :math:`i` in :math:`D`: - + .. math:: - + p_i = \frac{\sum_{d \in \{d \in D | y_d = i \}} W_d}{\sum_{d \in D} W_d} - + .. group-tab:: Regression *MSE* is an impurity metric for regression, calculated as follows: - - .. list-table:: + + .. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + + .. list-table:: MSE Impurity Metric :widths: 10 10 :header-rows: 1 :align: left - + :class: longtable + * - Without sample weights - With sample weights * - :math:`I_{\mathrm{MSE}}\left(D\right) = \frac{1}{W(D)} \sum _{i=1}^{W(D)}{\left(y_i - \frac{1}{W(D)} \sum _{j=1}^{W(D)} y_j \right)}^{2}` @@ -171,7 +177,7 @@ Maximal number of leaf nodes Grow trees with positive maximal number of leaf nodes in a :ref:`best-first ` fashion. Best nodes are defined by relative reduction in impurity. If maximal number of leaf nodes equals zero, then this criterion does not limit the number of leaf nodes, - and trees grow in a :ref:`depth-first ` fashion. + and trees grow in a :ref:`depth-first ` fashion. Tree Building Strategies ++++++++++++++++++++++++ @@ -185,7 +191,7 @@ Depth-first Strategy ~~~~~~~~~~~~~~~~~~~~ If maximal number of leaf nodes equals zero, a :ref:`decision tree
` is built using depth-first strategy. -In each terminal node :math:`t`, the following recursive procedure is applied: +In each terminal node :math:`t`, the following recursive procedure is applied: - Stop if the termination criteria are met. - Choose randomly without replacement :math:`m` feature indices :math:`J_t \in \{0, 1, \ldots, p-1\}`. @@ -225,7 +231,7 @@ Inference --------- Given decision forest classification or regression model and vectors :math:`x_1, \ldots, x_r`, -the problem is to calculate the responses for those vectors. +the problem is to calculate the responses for those vectors. .. _df_i_math_dense_hist: @@ -299,38 +305,38 @@ Variable Importance There are two main types of variable importance measures: -- *Mean Decrease Impurity* importance (MDI) +- *Mean Decrease Impurity* importance (MDI) - Importance of the :math:`j`-th variable for predicting :math:`Y` is the sum of - weighted impurity decreases :math:`p(t) \Delta i(s_t, t)` for all nodes - :math:`t` that use :math:`x_j`, averaged over all :math:`B` trees in the - forest: + Importance of the :math:`j`-th variable for predicting :math:`Y` is the sum of + weighted impurity decreases :math:`p(t) \Delta i(s_t, t)` for all nodes + :math:`t` that use :math:`x_j`, averaged over all :math:`B` trees in the + forest: - .. math:: - MDI\left(j\right)=\frac{1}{B}\sum _{b=1}^{B} \sum _{t\in {T}_{b}:v\left({s}_{t}\right)=j}p\left(t\right)\Delta i\left({s}_{t},t\right), + .. math:: + MDI\left(j\right)=\frac{1}{B}\sum _{b=1}^{B} \sum _{t\in {T}_{b}:v\left({s}_{t}\right)=j}p\left(t\right)\Delta i\left({s}_{t},t\right), - where :math:`p\left(t\right)=\frac{|{D}_{t}|}{|D|}` is the fraction of observations reaching node :math:`t` - in the tree :math:`T_b`, and :math:`v(s_t)` is the index of the - variable used in split :math:`s_t`. + where :math:`p\left(t\right)=\frac{|{D}_{t}|}{|D|}` is the fraction of observations reaching node :math:`t` + in the tree :math:`T_b`, and :math:`v(s_t)` is the index of the + variable used in split :math:`s_t`. -- *Mean Decrease Accuracy* (MDA) +- *Mean Decrease Accuracy* (MDA) - Importance of the :math:`j`-th variable for predicting :math:`Y` is the average - increase in the OOB error over all trees in the forest when the - values of the :math:`j`-th variable are randomly permuted in the OOB - set. For that reason, this latter measure is also known as - *permutation importance*. + Importance of the :math:`j`-th variable for predicting :math:`Y` is the average + increase in the OOB error over all trees in the forest when the + values of the :math:`j`-th variable are randomly permuted in the OOB + set. For that reason, this latter measure is also known as + *permutation importance*. - In more details, the library calculates MDA importance as - follows: + In more details, the library calculates MDA importance as + follows: - - Let :math:`\pi (X,j)` be the set of feature vectors where the :math:`j`-th variable is randomly permuted over all vectors in the set. - - Let :math:`E_b` be the OOB error calculated for :math:`T_b:` on its out-of-bag dataset :math:`\overline{D_b}`. - - Let :math:`E_{b,j}` be the OOB error calculated for :math:`T_b:` using :math:`\pi \left(\overline{{X}_{b}},j\right)`, and its out-of-bag dataset :math:`\overline{D_b}` is permuted on the :math:`j`-th variable. Then + - Let :math:`\pi (X,j)` be the set of feature vectors where the :math:`j`-th variable is randomly permuted over all vectors in the set. + - Let :math:`E_b` be the OOB error calculated for :math:`T_b:` on its out-of-bag dataset :math:`\overline{D_b}`. + - Let :math:`E_{b,j}` be the OOB error calculated for :math:`T_b:` using :math:`\pi \left(\overline{{X}_{b}},j\right)`, and its out-of-bag dataset :math:`\overline{D_b}` is permuted on the :math:`j`-th variable. Then - * :math:`{\delta }_{b,j}={E}_{b}-{E}_{b,j}` is the OOB error increase for the tree :math:`T_b`. - * :math:`Raw MDA\left(j\right)=\frac{1}{B}\sum _{b=1}^{B}{\delta }_{b,j}` is MDA importance. - * :math:`Scaled MDA\left(j\right)=\frac{Raw MDA\left({x}_{j}\right)}{\frac{{\sigma }_{j}}{\sqrt{B}}}`, where :math:`{\sigma }_{j}^{2}` is the variance of :math:`D_{b,j}` + * :math:`{\delta }_{b,j}={E}_{b}-{E}_{b,j}` is the OOB error increase for the tree :math:`T_b`. + * :math:`Raw MDA\left(j\right)=\frac{1}{B}\sum _{b=1}^{B}{\delta }_{b,j}` is MDA importance. + * :math:`Scaled MDA\left(j\right)=\frac{Raw MDA\left({x}_{j}\right)}{\frac{{\sigma }_{j}}{\sqrt{B}}}`, where :math:`{\sigma }_{j}^{2}` is the variance of :math:`D_{b,j}` --------------------- Programming Interface diff --git a/docs/source/onedal/algorithms/index.rst b/docs/source/onedal/algorithms/index.rst index f2bd165e8bd..f3f1b52c108 100644 --- a/docs/source/onedal/algorithms/index.rst +++ b/docs/source/onedal/algorithms/index.rst @@ -31,7 +31,7 @@ and regression algorithms, as well as association rules discovery. clustering/index.rst covariance/index.rst decomposition/index.rst - ensembles/index.rst + ensembles/index.rst kernel-functions/index.rst nearest-neighbors/index.rst pairwise-distances/index.rst diff --git a/docs/source/onedal/algorithms/svm/svm.rst b/docs/source/onedal/algorithms/svm/svm.rst index a1939c5d637..dc9990eb7cb 100644 --- a/docs/source/onedal/algorithms/svm/svm.rst +++ b/docs/source/onedal/algorithms/svm/svm.rst @@ -131,13 +131,13 @@ Working subset of α updated on each iteration of the algorithm is based on the Working Set Selection (WSS) 3 scheme [Fan05]_. The scheme can be optimized using one of these techniques or both: - - **Cache**: - the implementation can allocate a predefined amount of memory - to store intermediate results of the kernel computation. +- **Cache**: + the implementation can allocate a predefined amount of memory + to store intermediate results of the kernel computation. - - **Shrinking**: - the implementation can try to decrease the amount of kernel - related computations (see [Joachims99]_). +- **Shrinking**: + the implementation can try to decrease the amount of kernel + related computations (see [Joachims99]_). The solution of the problem defines the separating hyperplane and corresponding decision function :math:`D(x)= \sum_{k} {y_k \alpha_k K(x_k, x)} + b`, diff --git a/docs/source/onedal/appendix/decision-tree.rst b/docs/source/onedal/appendix/decision-tree.rst index 4f256d8d14b..8bed2e443da 100644 --- a/docs/source/onedal/appendix/decision-tree.rst +++ b/docs/source/onedal/appendix/decision-tree.rst @@ -33,13 +33,16 @@ the figure below, where: test - Each external node (leaf) denotes the mentioned simple model -.. image:: images/decision-tree-structure.png +.. figure:: images/decision-tree-structure.png :width: 600 + :alt: + + Decision Tree Structure A test is a rule for partitioning the feature space. A test depends on feature values. Each outcome of a test represents an appropriate hypercube associated with both the test and one of the -descending branches. +descending branches. If a test is a Boolean expression (for example, :math:`f < c` or :math:`f = c`, where :math:`f` is a feature and :math:`c` is a constant fitted diff --git a/docs/source/onedal/build_app/build-application.rst b/docs/source/onedal/build_app/build-application.rst index e3a4ad9f49d..9f817fa7f05 100644 --- a/docs/source/onedal/build_app/build-application.rst +++ b/docs/source/onedal/build_app/build-application.rst @@ -40,7 +40,7 @@ Applications on Windows* OS - Set |dpcpp| platform toolset: - .. image:: ./images/MSVSPlatformToolset.jpg + .. figure:: ./images/MSVSPlatformToolset.jpg :width: 600 :align: center :alt: In General configuration properties, choose Platform Toolset property @@ -48,64 +48,70 @@ Applications on Windows* OS - Add |short_name| ``includes`` folder to :guilabel:`Additional Include Directories`. - Add folders with |short_name| and oneTBB libraries to :guilabel:`Library Directories`: - .. image:: ./images/LibraryDirectories.jpg + .. figure:: ./images/LibraryDirectories.jpg :width: 600 :align: center :alt: In VC++ Directories, choose Library Directories property - Add |short_name| and OpenCL libraries to :guilabel:`Additional Dependencies`: - .. image:: ./images/AdditionalDependencies.jpg + .. figure:: ./images/AdditionalDependencies.jpg :width: 600 :align: center :alt: In Linker configuration properties, choose Input. #. Add the appropriate libraries to your project based on |short_name| threading mode and linking method: + .. tabularcolumns:: |\Y{0.2}|\Y{0.4}|\Y{0.4}| + .. list-table:: |short_name| libraries for Windows :widths: 15 25 25 :header-rows: 1 :align: left + :class: longtable * - - Single-threaded (non-threaded) - Multi-threaded (internally threaded) * - Static linking - - + - | onedal_core.lib, | onedal_sequential.lib - - + - | onedal_core.lib, | onedal_thread.lib * - Dynamic linking - onedal_core_dll.lib - onedal_core_dll.lib - You may also add debug versions of the libraries based on the treading mode and linking method: + You may also add debug versions of the libraries based on the threading mode and linking method: + + .. tabularcolumns:: |\Y{0.2}|\Y{0.4}|\Y{0.4}| .. list-table:: |short_name| debug libraries for Windows :widths: 15 25 25 :header-rows: 1 :align: left + :class: longtable * - - Single-threaded (non-threaded) - Multi-threaded (internally threaded) * - Static linking - - + - | onedal_cored.lib, | onedald.lib, | onedal_dpcd.lib, | onedal_sycld.lib, | onedal_sequentiald.lib - - + - | onedal_cored.lib, | onedald.lib, | onedal_dpcd.lib, | onedal_sycld.lib, | onedal_threadd.lib * - Dynamic linking - - + - | onedal_cored_dll.lib (onedal_cored_dll.1.lib), | onedald_dll.lib (onedald_dll.1.lib), | onedal_dpcd_dll.lib (onedal_dpcd_dll.1.lib), @@ -113,7 +119,7 @@ Applications on Windows* OS | onedal_cored.1.dll, | onedal_dpcd.1.dll, | onedal_sequentiald.1.dll - - + - | onedal_cored_dll.lib (onedal_cored_dll.1.lib), | onedald_dll.lib (onedald_dll.1.lib), | onedal_dpcd_dll.lib (onedal_dpcd_dll.1.lib), @@ -153,26 +159,29 @@ Applications on Linux* OS - Add |short_name| libraries. Choose the appropriate |short_name| libraries based on |short_name| threading mode and linking method: + .. tabularcolumns:: |\Y{0.2}|\Y{0.4}|\Y{0.4}| + .. list-table:: |short_name| libraries for Linux :widths: 15 25 25 :header-rows: 1 :align: left + :class: longtable * - - - Single-threaded (non-threaded) + - Single-threaded (non-threaded) - Multi-threaded (internally threaded) * - Static linking - - + - | libonedal_core.a, | libonedal_sequential.a - - + - | libonedal_core.a, | libonedal_thread.a * - Dynamic linking - - + - | libonedal_core.so, | libonedal_sequential.so - - + - | libonedal_core.so, | libonedal_thread.so diff --git a/docs/source/onedal/data-management/accessors.rst b/docs/source/onedal/data-management/accessors.rst index 428b10da2ee..e0147a9b0a3 100644 --- a/docs/source/onedal/data-management/accessors.rst +++ b/docs/source/onedal/data-management/accessors.rst @@ -35,18 +35,18 @@ Requirements Each accessor implementation: -1. Defines a single :term:`format of the data ` for the +#. Defines a single :term:`format of the data ` for the access. Every accessor type returns and use only one data format. -2. Provides read-only access to the data in the :txtref:`table` types. +#. Provides read-only access to the data in the :txtref:`table` types. -3. Provides the :code:`pull()` method for obtaining the values from the table. +#. Provides the :code:`pull()` method for obtaining the values from the table. -4. Is lightweight. Its constructors do not have computationally intensive +#. Is lightweight. Its constructors do not have computationally intensive operations such data copy, reading, or conversion. These operations are performed by method :code:`pull()`. -5. The :code:`pull()` method avoids data copy and conversion when it is +#. The :code:`pull()` method avoids data copy and conversion when it is possible to return the pointer to the memory block in the table. This is applicable for cases such as when the :capterm:`data format` and :capterm:`data types ` of the data within the table are the same as the @@ -64,9 +64,12 @@ specific way of obtaining data from the :txtref:`table`. All accessor classes in |short_name| are listed below: -.. list-table:: +.. tabularcolumns:: |\Y{0.25}|\Y{0.5}|\Y{0.25}| + +.. list-table:: Accessor Types :header-rows: 1 :widths: 25 50 25 + :class: longtable * - Accessor type - Description diff --git a/docs/source/onedal/data-management/array.rst b/docs/source/onedal/data-management/array.rst index b79e7fb823c..2da22a59287 100644 --- a/docs/source/onedal/data-management/array.rst +++ b/docs/source/onedal/data-management/array.rst @@ -26,20 +26,20 @@ Array The array is a simple concept over the data in |short_name|. It represents a storage that: -1. Holds the data allocated inside it or references to the external data. The +#. Holds the data allocated inside it or references to the external data. The data are organized as one :term:`homogeneous ` and :term:`contiguous ` memory block. -2. Contains information about the memory block's size. +#. Contains information about the memory block's size. -3. Supports both :term:`immutable ` and mutable data. +#. Supports both :term:`immutable ` and mutable data. -4. Provides an ability to change the data state from immutable to +#. Provides an ability to change the data state from immutable to mutable one. -5. Holds ownership information on the data (see the :txtref:`data_ownership_requirements` section). +#. Holds ownership information on the data (see the :txtref:`data_ownership_requirements` section). -6. Ownership information on the data can be shared between several arrays. It is +#. Ownership information on the data can be shared between several arrays. It is possible to create a new array from another one without any data copies. ------------- @@ -59,20 +59,20 @@ Data ownership requirements The array supports the following requirements on the internal data management: -1. An array owns two properties representing raw pointers to the data: +#. An array owns two properties representing raw pointers to the data: - ``data`` for a pointer to immutable data block - ``mutable_data`` for a pointer to mutable data block (see the :txtref:`api_array`) -2. If an array owns mutable data, both properties point to the same memory +#. If an array owns mutable data, both properties point to the same memory block. -3. If an array owns immutable data, ``mutable_data`` is ``nullptr``. +#. If an array owns immutable data, ``mutable_data`` is ``nullptr``. -4. An array stores the number of elements in the block it owns and updates +#. An array stores the number of elements in the block it owns and updates the ``count`` property when a new memory block is assigned to the array. -5. An array stores a pointer to the **ownership structure** of the data: +#. An array stores a pointer to the **ownership structure** of the data: - The **reference count** indicating how many array objects refer to the same memory block. @@ -80,14 +80,14 @@ The array supports the following requirements on the internal data management: - The **deleter** object used to free the memory block when reference count is zero. -6. An array creates the ownership structure for a new memory block not +#. An array creates the ownership structure for a new memory block not associated with such structure. -7. An array decrements the number of references to the memory block when the +#. An array decrements the number of references to the memory block when the array goes out of the scope. If the number of references is zero, the array calls the deleter on this memory block and free the ownership structure. -8. An array stores the pointer to the ownership structure created by another +#. An array stores the pointer to the ownership structure created by another array when they share the data. An array increments the reference count for it to be equal to the number of array objects sharing the same data. diff --git a/docs/source/onedal/data-management/data-sources.rst b/docs/source/onedal/data-management/data-sources.rst index 7dd4b56c0bb..aa8cacf9c93 100644 --- a/docs/source/onedal/data-management/data-sources.rst +++ b/docs/source/onedal/data-management/data-sources.rst @@ -164,7 +164,9 @@ Data Source Types |short_name| defines a set of classes. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Data Source Types :header-rows: 1 :widths: 10 70 diff --git a/docs/source/onedal/data-management/index.rst b/docs/source/onedal/data-management/index.rst index 505cb48983b..a21d3e362fd 100644 --- a/docs/source/onedal/data-management/index.rst +++ b/docs/source/onedal/data-management/index.rst @@ -27,24 +27,24 @@ between different stages of the :txtref:`data analytics pipeline contains three main steps of data acquisition, preparation, and computation (see :txtref:`the picture below `): -1. Raw data acquisition +#. Raw data acquisition - - Transfer out-of-memory data from various sources (databases, files, remote - storage) into an in-memory representation. + - Transfer out-of-memory data from various sources (databases, files, remote + storage) into an in-memory representation. -2. Data preparation +#. Data preparation - - Support different in-memory :capterm:`data formats `. - - Compress and decompress the data. - - Convert the data into numeric representation. - - Recover missing values. - - Filter the data and perform data normalization. - - Compute various statistical metrics for numerical data, such as mean, variance, - and covariance. + - Support different in-memory :capterm:`data formats `. + - Compress and decompress the data. + - Convert the data into numeric representation. + - Recover missing values. + - Filter the data and perform data normalization. + - Compute various statistical metrics for numerical data, such as mean, variance, + and covariance. -3. Algorithm computation +#. Algorithm computation - - Stream in-memory numerical data to the algorithm. + - Stream in-memory numerical data to the algorithm. In complex usage scenarios, data flow goes through these three stages back and forth. For example, when the data are not fully available at the start of the @@ -54,10 +54,12 @@ and prepared. .. _typical_data_management_flow: -.. image:: _static/data_management_flow.png +.. figure:: _static/data_management_flow.png :width: 800 :alt: Typical data management flow + Data Management Flow in oneDAL + Key concepts ============ @@ -73,20 +75,20 @@ Dataset The main data-related concept that |short_name| works with is a :capterm:`dataset`. It is a collection of data in a specific data format. -.. image:: _static/dataset.png +.. figure:: _static/dataset.png :width: 400 :alt: Dataset The dataset is used across all stages of the data analytics pipeline. For example: -1. At the acquisition stage, it is downloaded into the +#. At the acquisition stage, it is downloaded into the local memory. -2. At the preparation stage, it is converted into a numerical +#. At the preparation stage, it is converted into a numerical representation. -3. At the computation stage, it is used as one of the inputs or +#. At the computation stage, it is used as one of the inputs or results of an algorithm or a descriptor properties. .. _data-source: @@ -172,9 +174,9 @@ Table metadata Table metadata concept provides an additional information about data in the table: -1. The :capterm:`data types ` of the columns. +#. The :capterm:`data types ` of the columns. -2. The logical types of data in the columns: +#. The logical types of data in the columns: :capterm:`nominal `, :capterm:`ordinal `, :capterm:`interval `, or :capterm:`ratio `. @@ -219,10 +221,12 @@ of these concepts, which are highlighted by colors: .. _table_accessor_usage_example: -.. image:: _static/table_accessor_usage_example.png +.. figure:: _static/table_accessor_usage_example.png :width: 800 :alt: Sequence diagram of accessor-builder-table relations + Sequence diagram of accessor-builder-table relations + To perform computations on a dataset, you have to create a :txtref:`table` object first. It can be done either using a :txtref:`data-source` or directly from user-defined memory. The diagram shows the creation of a :txtref:`table` object diff --git a/docs/source/onedal/data-management/tables.rst b/docs/source/onedal/data-management/tables.rst index 6ce22dee727..a5c5802772b 100644 --- a/docs/source/onedal/data-management/tables.rst +++ b/docs/source/onedal/data-management/tables.rst @@ -24,9 +24,12 @@ Tables This section describes the types related to the :txtref:`table` concept. -.. list-table:: +.. tabularcolumns:: |\Y{0.2}|\Y{0.8}| + +.. list-table:: Table Types :header-rows: 1 :widths: 10 70 + :class: longtable * - Type - Description @@ -52,15 +55,15 @@ Requirements on table types Each implementation of :txtref:`table` concept: -1. Follows the definition of the :txtref:`table` concept and its restrictions +#. Follows the definition of the :txtref:`table` concept and its restrictions (e.g., :capterm:`immutability`). -2. Is derived from the :cpp:expr:`oneapi::dal::table` class. The behavior of this class can be +#. Is derived from the :cpp:expr:`oneapi::dal::table` class. The behavior of this class can be extended, but cannot be weaken. -3. Is :term:`reference-counted `. +#. Is :term:`reference-counted `. -4. Defines a unique id number: the "kind" that represents objects of that +#. Defines a unique id number: the "kind" that represents objects of that type in runtime. The following listing provides an example of table API to illustrate table kinds @@ -94,7 +97,9 @@ Table types |short_name| defines a set of classes that implement the :txtref:`table` concept for a specific data format: -.. list-table:: +.. tabularcolumns:: |\Y{0.3}|\Y{0.7}| + +.. list-table:: Table Types for specific data formats :header-rows: 1 :widths: 30 70 diff --git a/docs/source/onedal/get-started/build-and-run-examples.rst b/docs/source/onedal/get-started/build-and-run-examples.rst index 8e0fbf54a8e..2b0872032c5 100644 --- a/docs/source/onedal/get-started/build-and-run-examples.rst +++ b/docs/source/onedal/get-started/build-and-run-examples.rst @@ -29,103 +29,103 @@ basic usage scenarios of |short_name| with DPCPP. Go to All content below that starts with ``#`` is considered a comment and should not be run with the code. -1. Set up the required environment for |short_name| +#. Set up the required environment for |short_name| (variables such as ``CPATH``, ``LIBRARY_PATH``, and ``LD_LIBRARY_PATH``): - .. tabs:: + .. tabs:: - .. group-tab:: Linux + .. group-tab:: Linux - On Linux, there are two possible ways to set up the required environment: - via ``vars.sh`` script or via ``modulefiles``. + On Linux, there are two possible ways to set up the required environment: + via ``vars.sh`` script or via ``modulefiles``. - * Setting up |short_name| environment via ``vars.sh`` script + * Setting up |short_name| environment via ``vars.sh`` script - Run the following command: + Run the following command: - .. code-block:: bash + .. code-block:: bash - source ./env/vars.sh + source ./env/vars.sh - * Setting up |short_name| environment via ``modulefiles`` + * Setting up |short_name| environment via ``modulefiles`` - 1. Initialize ``modules``: + #. Initialize ``modules``: - .. code-block:: bash + .. code-block:: bash - source $MODULESHOME/init/bash + source $MODULESHOME/init/bash - .. note:: Refer to `Environment Modules documentation `_ for details. + .. note:: Refer to `Environment Modules documentation `_ for details. - 2. Provide ``modules`` with a path to the ``modulefiles`` directory: + #. Provide ``modules`` with a path to the ``modulefiles`` directory: - .. code-block:: bash + .. code-block:: bash - module use ./modulefiles + module use ./modulefiles - 3. Run the module: + #. Run the module: - .. code-block:: bash + .. code-block:: bash - module load dal + module load dal - .. group-tab:: Windows + .. group-tab:: Windows - Run the following command: + Run the following command: - .. code-block:: bash + .. code-block:: bash - /env/vars.bat + /env/vars.bat -2. Copy ``./examples/oneapi/dpc`` to a writable directory if necessary (since it creates temporary files): +#. Copy ``./examples/oneapi/dpc`` to a writable directory if necessary (since it creates temporary files): - .. code-block:: bash + .. code-block:: bash - cp –r ./examples/oneapi/dpc ${WRITABLE_DIR} + cp –r ./examples/oneapi/dpc ${WRITABLE_DIR} -3. Set up the compiler environment for |dpcpp|. +#. Set up the compiler environment for |dpcpp|. See |dpcpp_gsg|_ for details. -4. Build and run DPC++ examples: +#. Build and run DPC++ examples: - .. note:: + .. note:: - You need to have write permissions to the :file:`examples` folder - to build examples, and execute permissions to run them. - Otherwise, you need to copy :file:`examples/oneapi/dpc` and :file:`examples/oneapi/data` folders - to the directory with right permissions. These two folders must be retained - in the same directory level relative to each other. + You need to have write permissions to the :file:`examples` folder + to build examples, and execute permissions to run them. + Otherwise, you need to copy :file:`examples/oneapi/dpc` and :file:`examples/oneapi/data` folders + to the directory with right permissions. These two folders must be retained + in the same directory level relative to each other. - .. tabs:: + .. tabs:: - .. group-tab:: Linux + .. group-tab:: Linux - .. code-block:: bash + .. code-block:: bash - # Navigate to DPC++ examples directory and build examples - cd /examples/oneapi/dpc - make so example=svm_two_class_thunder_dense_batch # This will compile and run Correlation example using Intel(R) oneAPI DPC++/C++ Compiler - make so mode=build # This will compile all DPC++ examples + # Navigate to DPC++ examples directory and build examples + cd /examples/oneapi/dpc + make so example=svm_two_class_thunder_dense_batch # This will compile and run Correlation example using Intel(R) oneAPI DPC++/C++ Compiler + make so mode=build # This will compile all DPC++ examples - .. group-tab:: Windows + .. group-tab:: Windows - .. code-block:: bash + .. code-block:: bash - # Navigate to DPC++ examples directory and build examples - cd /examples/oneapi/dpc - nmake dll example=svm_two_class_thunder_dense_batch+ # This will compile and run Correlation example using Intel(R) oneAPI DPC++/C++ Compiler - nmake dll mode=build # This will compile all DPC++ examples + # Navigate to DPC++ examples directory and build examples + cd /examples/oneapi/dpc + nmake dll example=svm_two_class_thunder_dense_batch+ # This will compile and run Correlation example using Intel(R) oneAPI DPC++/C++ Compiler + nmake dll mode=build # This will compile all DPC++ examples - To see all available parameters of the build procedure, type ``make`` on Linux\* or ``nmake`` on Windows\*. + To see all available parameters of the build procedure, type ``make`` on Linux\* or ``nmake`` on Windows\*. -5. The resulting example binaries and log files are written into the :file:`_results` directory. +#. The resulting example binaries and log files are written into the :file:`_results` directory. - .. note:: + .. note:: - You should run DPC++ examples from :file:`examples/oneapi/dpc` folder, not from :file:`_results` folder. - Most examples require data to be stored in :file:`examples/oneapi/data` folder and to have a relative link to it - started from :file:`examples/oneapi/dpc` folder. + You should run DPC++ examples from :file:`examples/oneapi/dpc` folder, not from :file:`_results` folder. + Most examples require data to be stored in :file:`examples/oneapi/data` folder and to have a relative link to it + started from :file:`examples/oneapi/dpc` folder. - You can build traditional C++ examples located in ``examples/oneapi/cpp`` folder in a similar way. + You can build traditional C++ examples located in ``examples/oneapi/cpp`` folder in a similar way.