pub trait LogisticRegressionConst: StatModelConst {
    fn as_raw_LogisticRegression(&self) -> *const c_void;

    fn get_learning_rate(&self) -> Result<f64> { ... }
    fn get_iterations(&self) -> Result<i32> { ... }
    fn get_regularization(&self) -> Result<i32> { ... }
    fn get_train_method(&self) -> Result<i32> { ... }
    fn get_mini_batch_size(&self) -> Result<i32> { ... }
    fn get_term_criteria(&self) -> Result<TermCriteria> { ... }
    fn predict(
        &self,
        samples: &dyn ToInputArray,
        results: &mut dyn ToOutputArray,
        flags: i32
    ) -> Result<f32> { ... } fn get_learnt_thetas(&self) -> Result<Mat> { ... } }
Expand description

Implements Logistic Regression classifier.

See also

@ref ml_intro_lr

Required Methods

Provided Methods

Learning rate.

See also

setLearningRate

Number of iterations.

See also

setIterations

Kind of regularization to be applied. See LogisticRegression::RegKinds.

See also

setRegularization

Kind of training method used. See LogisticRegression::Methods.

See also

setTrainMethod

Specifies the number of training samples taken in each step of Mini-Batch Gradient Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. It has to take values less than the total number of training samples.

See also

setMiniBatchSize

Termination criteria of the algorithm.

See also

setTermCriteria

Predicts responses for input samples and returns a float type.

Parameters
  • samples: The input data for the prediction algorithm. Matrix [m x n], where each row contains variables (features) of one object being classified. Should have data type CV_32F.
  • results: Predicted labels as a column matrix of type CV_32S.
  • flags: Not used.
C++ default parameters
  • results: noArray()
  • flags: 0

This function returns the trained parameters arranged across rows.

For a two class classification problem, it returns a row matrix. It returns learnt parameters of the Logistic Regression as a matrix of type CV_32F.

Implementors