Skip to content

ml

All modules / ml

ml_ANN_MLPclass

\

ml_ANN_MLP_ActivationFunctionsclass

possible activation functions

ml_ANN_MLP_createfunction

Creates empty model

ml_ANN_MLP_loadfunction

Loads and creates a serialized ANN from a file

ml_ANN_MLP_TrainFlagsclass

ml_ANN_MLP_TrainFlags: Train options

ml_ANN_MLP_TrainingMethodsclass

Available training methods

ml_Boostclass

\

ml_Boost_createfunction

Creates the empty model.

ml_Boost_loadfunction

Loads and creates a serialized Boost from a file

ml_Boost_Typesclass

Boosting type.

ml_DTreesclass

\

ml_DTrees_createfunction

Creates the empty model

ml_DTrees_Flagsclass

Predict options

ml_DTrees_loadfunction

Loads and creates a serialized DTrees from a file

ml_EMclass

\

ml_EM_createfunction

Creates empty %EM model.

ml_EM_loadfunction

Loads and creates a serialized EM from a file

ml_EM_Typesclass

Type of covariation matrices

ml_ErrorTypesclass

ml_ErrorTypes: %Error types

ml_KNearestclass

\

ml_KNearest_createfunction

Creates the empty model

ml_KNearest_loadfunction

Loads and creates a serialized knearest from a file

ml_KNearest_Typesclass

Implementations of KNearest algorithm

ml_LogisticRegressionclass

\

ml_LogisticRegression_createfunction

Creates empty model.

ml_LogisticRegression_loadfunction

Loads and creates a serialized LogisticRegression from a file

ml_LogisticRegression_Methodsclass

Training methods

ml_LogisticRegression_RegKindsclass

Regularization kinds

ml_NormalBayesClassifierclass

\

ml_NormalBayesClassifier_createfunction

Creates empty model

ml_NormalBayesClassifier_loadfunction

Loads and creates a serialized NormalBayesClassifier from a file

ml_ParamGridclass

The structure represents the logarithmic grid range of statmodel parameters.

ml_ParamGrid_createfunction

Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method

ml_RTreesclass

\

ml_RTrees_createfunction

Creates the empty model.

ml_RTrees_loadfunction

Loads and creates a serialized RTree from a file

ml_SampleTypesclass

ml_SampleTypes: Sample types

ml_StatModelclass

Base class for statistical models in OpenCV ML.

ml_StatModel_Flagsclass

Predict options

ml_SVMclass

\

ml_SVM_createfunction

Creates empty model.

ml_SVM_getDefaultGridPtrfunction

Generates a grid for %SVM parameters.

ml_SVM_KernelTypesclass

%SVM kernel type

ml_SVM_loadfunction

Loads and creates a serialized svm from a file

ml_SVM_ParamTypesclass

%SVM params type

ml_SVM_Typesclass

ml_SVM_Types: %SVM type

ml_SVMSGDclass

\

ml_SVMSGD_createfunction

Creates empty model.

ml_SVMSGD_loadfunction

Loads and creates a serialized SVMSGD from a file

ml_SVMSGD_MarginTypeclass

ml_SVMSGD_MarginType: Margin type.

ml_SVMSGD_SvmsgdTypeclass

SVMSGD type.

ml_TrainDataclass

Class encapsulating training data.

ml_TrainData_createfunction

Creates training data from in-memory arrays.

ml_TrainData_getSubMatrixfunction

Extract from matrix rows/cols specified by passed indexes.

ml_TrainData_getSubVectorfunction

Extract from 1D vector elements specified by passed indexes.

ml_VariableTypesclass

ml_VariableTypes: Variable types

Constants

Use the named constant from cv. In particular, OpenCV 5 matrix type codes differ from OpenCV 4.

ml_VAR_NUMERICAL

same as VAR_ORDERED

ml_VAR_ORDERED

ordered variables

ml_VAR_CATEGORICAL

categorical variables

ml_TEST_ERROR

ml test error constant (0), defined by OpenCV for cv::ml.

ml_TRAIN_ERROR

ml train error constant (1), defined by OpenCV for cv::ml.

ml_ROW_SAMPLE

each training sample is a row of samples

ml_COL_SAMPLE

each training sample occupies a column of samples

ml_StatModel_UPDATE_MODEL

ml stat model update model constant (1), defined by OpenCV for cv::ml::StatModel.

ml_STAT_MODEL_UPDATE_MODEL

ml stat model update model constant (1), defined by OpenCV for cv::ml::StatModel.

ml_StatModel_RAW_OUTPUT

makes the method return the raw results (the sum), not the class label

ml_STAT_MODEL_RAW_OUTPUT

makes the method return the raw results (the sum), not the class label

ml_StatModel_COMPRESSED_INPUT

makes the method return the raw results (the sum), not the class label

ml_STAT_MODEL_COMPRESSED_INPUT

makes the method return the raw results (the sum), not the class label

ml_StatModel_PREPROCESSED_INPUT

ml stat model preprocessed input constant (4), defined by OpenCV for cv::ml::StatModel.

ml_STAT_MODEL_PREPROCESSED_INPUT

ml stat model preprocessed input constant (4), defined by OpenCV for cv::ml::StatModel.

ml_KNearest_BRUTE_FORCE

ml knearest brute force constant (1), defined by OpenCV for cv::ml::KNearest.

ml_KNEAREST_BRUTE_FORCE

ml knearest brute force constant (1), defined by OpenCV for cv::ml::KNearest.

ml_KNearest_KDTREE

ml knearest kdtree constant (2), defined by OpenCV for cv::ml::KNearest.

ml_KNEAREST_KDTREE

ml knearest kdtree constant (2), defined by OpenCV for cv::ml::KNearest.

ml_SVM_C_SVC

C-Support Vector Classification. n-class classification (n \geq 2), allows imperfect separation of classes with penalty multiplier C for outliers.

ml_SVM_NU_SVC

\nu-Support Vector Classification. n-class classification with possible imperfect separation. Parameter \nu (in the range 0..1, the larger the value, the smoother the decision boundary) is used instead of C.

ml_SVM_ONE_CLASS

Distribution Estimation (One-class %SVM). All the training data are from the same class, %SVM builds a boundary that separates the class from the rest of the feature space.

ml_SVM_EPS_SVR

\epsilon-Support Vector Regression. The distance between feature vectors from the training set and the fitting hyper-plane must be less than p. For outliers the penalty multiplier C is used.

ml_SVM_NU_SVR

\nu-Support Vector Regression. \nu is used instead of p. See [LibSVM] for details.

ml_SVM_CUSTOM

Returned by SVM::getKernelType in case when custom kernel has been set

ml_SVM_LINEAR

Linear kernel. No mapping is done, linear discrimination (or regression) is done in the original feature space. It is the fastest option. K(x_i, x_j) = x_i^T x_j.

ml_SVM_POLY

Polynomial kernel: K(x_i, x_j) = (\gamma x_i^T x_j + coef0)^{degree}, \gamma > 0.

ml_SVM_RBF

Exponential Chi2 kernel, similar to the RBF kernel:

ml_SVM_SIGMOID

Sigmoid kernel: K(x_i, x_j) = \tanh(\gamma x_i^T x_j + coef0).

ml_SVM_CHI2

Exponential Chi2 kernel, similar to the RBF kernel: K(x_i, x_j) = e^{-\gamma \chi^2(x_i,x_j)}, \chi^2(x_i,x_j) = (x_i-x_j)^2/(x_i+x_j), \gamma > 0.

ml_SVM_INTER

Histogram intersection kernel. A fast kernel. K(x_i, x_j) = min(x_i,x_j).

ml_SVM_C

ml svm c constant (0), defined by OpenCV for cv::ml::SVM.

ml_SVM_GAMMA

ml svm gamma constant (1), defined by OpenCV for cv::ml::SVM.

ml_SVM_P

ml svm p constant (2), defined by OpenCV for cv::ml::SVM.

ml_SVM_NU

ml svm nu constant (3), defined by OpenCV for cv::ml::SVM.

ml_SVM_COEF

ml svm coef constant (4), defined by OpenCV for cv::ml::SVM.

ml_SVM_DEGREE

ml svm degree constant (5), defined by OpenCV for cv::ml::SVM.

ml_EM_COV_MAT_SPHERICAL

A scaled identity matrix \mu_k * I. There is the only parameter \mu_k to be estimated for each matrix. The option may be used in special cases, when the constraint is relevant, or as a first step in the optimization (for example in case when the data is preprocessed with PCA). The results of such preliminary estimation may be passed again to the optimization procedure, this time with covMatType=EM::COV_MAT_DIAGONAL.

ml_EM_COV_MAT_DIAGONAL

A symmetric positively defined matrix. The number of free

ml_EM_COV_MAT_GENERIC

A symmetric positively defined matrix. The number of free parameters in each matrix is about d^2/2. It is not recommended to use this option, unless there is pretty accurate initial estimation of the parameters and/or a huge number of training samples.

ml_EM_COV_MAT_DEFAULT

ml em cov mat default constant (COV_MAT_DIAGONAL), defined by OpenCV for cv::ml::EM.

ml_EM_DEFAULT_NCLUSTERS

Default parameters

ml_EM_DEFAULT_MAX_ITERS

Default parameters

ml_EM_START_E_STEP

The initial step

ml_EM_START_M_STEP

The initial step

ml_EM_START_AUTO_STEP

The initial step

ml_DTrees_PREDICT_AUTO

Predict options

ml_DTREES_PREDICT_AUTO

Predict options

ml_DTrees_PREDICT_SUM

Predict options

ml_DTREES_PREDICT_SUM

Predict options

ml_DTrees_PREDICT_MAX_VOTE

Predict options

ml_DTREES_PREDICT_MAX_VOTE

Predict options

ml_DTrees_PREDICT_MASK

Predict options

ml_DTREES_PREDICT_MASK

Predict options

ml_Boost_DISCRETE

Discrete AdaBoost.

ml_BOOST_DISCRETE

Discrete AdaBoost.

ml_Boost_REAL

Real AdaBoost. It is a technique that utilizes confidence-rated predictions

ml_BOOST_REAL

Real AdaBoost. It is a technique that utilizes confidence-rated predictions

ml_Boost_LOGIT

LogitBoost. It can produce good regression fits.

ml_BOOST_LOGIT

LogitBoost. It can produce good regression fits.

ml_Boost_GENTLE

Gentle AdaBoost. It puts less weight on outlier data points and for that

ml_BOOST_GENTLE

Gentle AdaBoost. It puts less weight on outlier data points and for that

ml_ANN_MLP_BACKPROP

The back-propagation algorithm.

ml_ANN_MLP_RPROP

The RPROP algorithm. See [RPROP93] for details.

ml_ANN_MLP_ANNEAL

The simulated annealing algorithm. See [Kirkpatrick83] for details.

ml_ANN_MLP_IDENTITY

Identity function: f(x)=x

ml_ANN_MLP_SIGMOID_SYM

Symmetrical sigmoid: f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x})

Note: If you are using the default sigmoid activation function with the default parameter values fparam1=0 and fparam2=0 then the function used is y = 1.7159*tanh(2/3 * x), so the output will range from [-1.7159, 1.7159], instead of [0,1].

ml_ANN_MLP_GAUSSIAN

Gaussian function: f(x)=\beta e^{-\alpha x*x}

ml_ANN_MLP_RELU

ReLU function: f(x)=max(0,x)

ml_ANN_MLP_LEAKYRELU

Leaky ReLU function: for x>0 f(x)=x and x<=0 f(x)=\alpha x

ml_ANN_MLP_UPDATE_WEIGHTS

Update the network weights, rather than compute them from scratch. In the latter case the weights are initialized using the Nguyen-Widrow algorithm.

ml_ANN_MLP_NO_INPUT_SCALE

Do not normalize the input vectors. If this flag is not set, the training algorithm normalizes each input feature independently, shifting its mean value to 0 and making the standard deviation equal to 1. If the network is assumed to be updated frequently, the new training data could be much different from original one. In this case, you should take care of proper normalization.

ml_ANN_MLP_NO_OUTPUT_SCALE

Do not normalize the output vectors. If the flag is not set, the training algorithm normalizes each output feature independently, by transforming it to the certain range depending on the used activation function.

ml_LogisticRegression_REG_DISABLE

Regularization disabled

ml_LOGISTIC_REGRESSION_REG_DISABLE

Regularization disabled

ml_LogisticRegression_REG_L1

ml_LogisticRegression_REG_L1: %L1 norm

ml_LOGISTIC_REGRESSION_REG_L1

ml_LOGISTIC_REGRESSION_REG_L1: %L1 norm

ml_LogisticRegression_REG_L2

ml_LogisticRegression_REG_L2: %L2 norm

ml_LOGISTIC_REGRESSION_REG_L2

ml_LOGISTIC_REGRESSION_REG_L2: %L2 norm

ml_LogisticRegression_BATCH

ml logistic regression batch constant (0), defined by OpenCV for cv::ml::LogisticRegression.

ml_LOGISTIC_REGRESSION_BATCH

ml logistic regression batch constant (0), defined by OpenCV for cv::ml::LogisticRegression.

ml_LogisticRegression_MINI_BATCH

Set MiniBatchSize to a positive integer when using this method.

ml_LOGISTIC_REGRESSION_MINI_BATCH

Set MiniBatchSize to a positive integer when using this method.

ml_SVMSGD_SGD

Stochastic Gradient Descent

ml_SVMSGD_ASGD

Average Stochastic Gradient Descent

ml_SVMSGD_SOFT_MARGIN

General case, suits to the case of non-linearly separable sets, allows outliers.

ml_SVMSGD_HARD_MARGIN

More accurate for the case of linearly separable sets.