[][src]Trait opencv::hub_prelude::LogisticRegression

pub trait LogisticRegression: StatModel {
    pub fn as_raw_LogisticRegression(&self) -> *const c_void;
pub fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void; pub fn get_learning_rate(&self) -> Result<f64> { ... }
pub fn set_learning_rate(&mut self, val: f64) -> Result<()> { ... }
pub fn get_iterations(&self) -> Result<i32> { ... }
pub fn set_iterations(&mut self, val: i32) -> Result<()> { ... }
pub fn get_regularization(&self) -> Result<i32> { ... }
pub fn set_regularization(&mut self, val: i32) -> Result<()> { ... }
pub fn get_train_method(&self) -> Result<i32> { ... }
pub fn set_train_method(&mut self, val: i32) -> Result<()> { ... }
pub fn get_mini_batch_size(&self) -> Result<i32> { ... }
pub fn set_mini_batch_size(&mut self, val: i32) -> Result<()> { ... }
pub fn get_term_criteria(&self) -> Result<TermCriteria> { ... }
pub fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()> { ... }
pub fn predict(
        &self,
        samples: &dyn ToInputArray,
        results: &mut dyn ToOutputArray,
        flags: i32
    ) -> Result<f32> { ... }
pub fn get_learnt_thetas(&self) -> Result<Mat> { ... } }

Implements Logistic Regression classifier.

See also

@ref ml_intro_lr

Required methods

Loading content...

Provided methods

pub fn get_learning_rate(&self) -> Result<f64>[src]

Learning rate.

See also

setLearningRate

pub fn set_learning_rate(&mut self, val: f64) -> Result<()>[src]

Learning rate.

See also

setLearningRate getLearningRate

pub fn get_iterations(&self) -> Result<i32>[src]

Number of iterations.

See also

setIterations

pub fn set_iterations(&mut self, val: i32) -> Result<()>[src]

Number of iterations.

See also

setIterations getIterations

pub fn get_regularization(&self) -> Result<i32>[src]

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

See also

setRegularization

pub fn set_regularization(&mut self, val: i32) -> Result<()>[src]

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

See also

setRegularization getRegularization

pub fn get_train_method(&self) -> Result<i32>[src]

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

See also

setTrainMethod

pub fn set_train_method(&mut self, val: i32) -> Result<()>[src]

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

See also

setTrainMethod getTrainMethod

pub fn get_mini_batch_size(&self) -> Result<i32>[src]

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

pub fn set_mini_batch_size(&mut self, val: i32) -> Result<()>[src]

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 getMiniBatchSize

pub fn get_term_criteria(&self) -> Result<TermCriteria>[src]

Termination criteria of the algorithm.

See also

setTermCriteria

pub fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>[src]

Termination criteria of the algorithm.

See also

setTermCriteria getTermCriteria

pub fn predict(
    &self,
    samples: &dyn ToInputArray,
    results: &mut dyn ToOutputArray,
    flags: i32
) -> Result<f32>
[src]

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

pub fn get_learnt_thetas(&self) -> Result<Mat>[src]

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.

Loading content...

Implementations

impl<'_> dyn LogisticRegression + '_[src]

pub fn create() -> Result<Ptr<dyn LogisticRegression>>[src]

Creates empty model.

Creates Logistic Regression model with parameters given.

pub fn load(
    filepath: &str,
    node_name: &str
) -> Result<Ptr<dyn LogisticRegression>>
[src]

Loads and creates a serialized LogisticRegression from a file

Use LogisticRegression::save to serialize and store an LogisticRegression to disk. Load the LogisticRegression from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier

Parameters

  • filepath: path to serialized LogisticRegression
  • nodeName: name of node containing the classifier

C++ default parameters

  • node_name: String()

Implementors

Loading content...