pub trait LogisticRegressionTraitConst: StatModelTraitConst {
// Required method
fn as_raw_LogisticRegression(&self) -> *const c_void;
// Provided methods
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: &impl ToInputArray,
results: &mut impl ToOutputArray,
flags: i32,
) -> Result<f32> { ... }
fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32> { ... }
fn get_learnt_thetas(&self) -> Result<Mat> { ... }
}
Expand description
Constant methods for crate::ml::LogisticRegression
Required Methods§
fn as_raw_LogisticRegression(&self) -> *const c_void
Provided Methods§
sourcefn get_learning_rate(&self) -> Result<f64>
fn get_learning_rate(&self) -> Result<f64>
sourcefn get_iterations(&self) -> Result<i32>
fn get_iterations(&self) -> Result<i32>
sourcefn get_regularization(&self) -> Result<i32>
fn get_regularization(&self) -> Result<i32>
sourcefn get_train_method(&self) -> Result<i32>
fn get_train_method(&self) -> Result<i32>
sourcefn get_mini_batch_size(&self) -> Result<i32>
fn get_mini_batch_size(&self) -> Result<i32>
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
sourcefn get_term_criteria(&self) -> Result<TermCriteria>
fn get_term_criteria(&self) -> Result<TermCriteria>
sourcefn predict(
&self,
samples: &impl ToInputArray,
results: &mut impl ToOutputArray,
flags: i32,
) -> Result<f32>
fn predict( &self, samples: &impl ToInputArray, results: &mut impl ToOutputArray, flags: i32, ) -> Result<f32>
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
sourcefn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
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.
§Note
This alternative version of LogisticRegressionTraitConst::predict function uses the following default values for its arguments:
- results: noArray()
- flags: 0
sourcefn get_learnt_thetas(&self) -> Result<Mat>
fn get_learnt_thetas(&self) -> Result<Mat>
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.