Struct opencv::ml::LogisticRegression
source · pub struct LogisticRegression { /* private fields */ }
Expand description
Implementations§
source§impl LogisticRegression
impl LogisticRegression
sourcepub fn create() -> Result<Ptr<LogisticRegression>>
pub fn create() -> Result<Ptr<LogisticRegression>>
Creates empty model.
Creates Logistic Regression model with parameters given.
sourcepub fn load(filepath: &str, node_name: &str) -> Result<Ptr<LogisticRegression>>
pub fn load(filepath: &str, node_name: &str) -> Result<Ptr<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()
Trait Implementations§
source§impl AlgorithmTrait for LogisticRegression
impl AlgorithmTrait for LogisticRegression
source§impl AlgorithmTraitConst for LogisticRegression
impl AlgorithmTraitConst for LogisticRegression
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut FileStorage) -> Result<()>
fn write(&self, fs: &mut FileStorage) -> Result<()>
Stores algorithm parameters in a file storage
source§fn write_1(&self, fs: &mut FileStorage, name: &str) -> Result<()>
fn write_1(&self, fs: &mut FileStorage, name: &str) -> Result<()>
Stores algorithm parameters in a file storage Read more
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
@deprecated Read more
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
Saves the algorithm to a file.
In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string.
source§impl Boxed for LogisticRegression
impl Boxed for LogisticRegression
source§impl Drop for LogisticRegression
impl Drop for LogisticRegression
source§impl From<LogisticRegression> for Algorithm
impl From<LogisticRegression> for Algorithm
source§fn from(s: LogisticRegression) -> Self
fn from(s: LogisticRegression) -> Self
Converts to this type from the input type.
source§impl LogisticRegressionTrait for LogisticRegression
impl LogisticRegressionTrait for LogisticRegression
fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void
source§fn set_regularization(&mut self, val: i32) -> Result<()>
fn set_regularization(&mut self, val: i32) -> Result<()>
Kind of regularization to be applied. See LogisticRegression::RegKinds. Read more
source§fn 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. Read more
source§fn 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. Read more
source§fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
Termination criteria of the algorithm. Read more
source§impl LogisticRegressionTraitConst for LogisticRegression
impl LogisticRegressionTraitConst for LogisticRegression
fn as_raw_LogisticRegression(&self) -> *const c_void
source§fn get_regularization(&self) -> Result<i32>
fn get_regularization(&self) -> Result<i32>
Kind of regularization to be applied. See LogisticRegression::RegKinds. Read more
source§fn get_train_method(&self) -> Result<i32>
fn get_train_method(&self) -> Result<i32>
Kind of training method used. See LogisticRegression::Methods. Read more
source§fn 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. Read more
source§fn get_term_criteria(&self) -> Result<TermCriteria>
fn get_term_criteria(&self) -> Result<TermCriteria>
Termination criteria of the algorithm. Read more
source§fn 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. Read more
source§impl StatModelTrait for LogisticRegression
impl StatModelTrait for LogisticRegression
fn as_raw_mut_StatModel(&mut self) -> *mut c_void
source§fn train_with_data(
&mut self,
train_data: &Ptr<TrainData>,
flags: i32
) -> Result<bool>
fn train_with_data( &mut self, train_data: &Ptr<TrainData>, flags: i32 ) -> Result<bool>
Trains the statistical model Read more
source§fn train(
&mut self,
samples: &impl ToInputArray,
layout: i32,
responses: &impl ToInputArray
) -> Result<bool>
fn train( &mut self, samples: &impl ToInputArray, layout: i32, responses: &impl ToInputArray ) -> Result<bool>
Trains the statistical model Read more
source§impl StatModelTraitConst for LogisticRegression
impl StatModelTraitConst for LogisticRegression
fn as_raw_StatModel(&self) -> *const c_void
source§fn get_var_count(&self) -> Result<i32>
fn get_var_count(&self) -> Result<i32>
Returns the number of variables in training samples
fn empty(&self) -> Result<bool>
source§fn is_trained(&self) -> Result<bool>
fn is_trained(&self) -> Result<bool>
Returns true if the model is trained
source§fn is_classifier(&self) -> Result<bool>
fn is_classifier(&self) -> Result<bool>
Returns true if the model is classifier
source§fn calc_error(
&self,
data: &Ptr<TrainData>,
test: bool,
resp: &mut impl ToOutputArray
) -> Result<f32>
fn calc_error( &self, data: &Ptr<TrainData>, test: bool, resp: &mut impl ToOutputArray ) -> Result<f32>
Computes error on the training or test dataset Read more
source§fn 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 response(s) for the provided sample(s) Read more
impl Send for LogisticRegression
Auto Trait Implementations§
impl RefUnwindSafe for LogisticRegression
impl !Sync for LogisticRegression
impl Unpin for LogisticRegression
impl UnwindSafe for LogisticRegression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more