Trait opencv::prelude::LogisticRegression
source · pub trait LogisticRegression: LogisticRegressionConst + StatModel {
// Required method
fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void;
// Provided methods
fn set_learning_rate(&mut self, val: f64) -> Result<()> { ... }
fn set_iterations(&mut self, val: i32) -> Result<()> { ... }
fn set_regularization(&mut self, val: i32) -> Result<()> { ... }
fn set_train_method(&mut self, val: i32) -> Result<()> { ... }
fn set_mini_batch_size(&mut self, val: i32) -> Result<()> { ... }
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()> { ... }
}
Expand description
Required Methods§
fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_learning_rate(&mut self, val: f64) -> Result<()>
fn set_learning_rate(&mut self, val: f64) -> Result<()>
sourcefn set_iterations(&mut self, val: i32) -> Result<()>
fn set_iterations(&mut self, val: i32) -> Result<()>
sourcefn set_regularization(&mut self, val: i32) -> Result<()>
fn set_regularization(&mut self, val: i32) -> Result<()>
Kind of regularization to be applied. See LogisticRegression::RegKinds.
See also
setRegularization getRegularization
sourcefn set_train_method(&mut self, val: i32) -> Result<()>
fn set_train_method(&mut self, val: i32) -> Result<()>
Kind of training method used. See LogisticRegression::Methods.
See also
setTrainMethod getTrainMethod
sourcefn set_mini_batch_size(&mut self, val: i32) -> Result<()>
fn set_mini_batch_size(&mut self, val: i32) -> Result<()>
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
sourcefn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
Implementations§
source§impl dyn LogisticRegression + '_
impl dyn LogisticRegression + '_
sourcepub fn create() -> Result<Ptr<dyn LogisticRegression>>
pub fn create() -> Result<Ptr<dyn LogisticRegression>>
Creates empty model.
Creates Logistic Regression model with parameters given.
sourcepub fn load(
filepath: &str,
node_name: &str
) -> Result<Ptr<dyn LogisticRegression>>
pub fn load( filepath: &str, node_name: &str ) -> Result<Ptr<dyn LogisticRegression>>
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()