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()
Sourcepub fn load_def(filepath: &str) -> Result<Ptr<LogisticRegression>>
pub fn load_def(filepath: &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
§Note
This alternative version of LogisticRegression::load function uses the following default values for its arguments:
- 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 impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
Source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
Source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
Source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
Source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
Source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
Source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
Source§impl Boxed for LogisticRegression
impl Boxed for LogisticRegression
Source§unsafe fn from_raw(
ptr: <LogisticRegression as OpenCVFromExtern>::ExternReceive,
) -> Self
unsafe fn from_raw( ptr: <LogisticRegression as OpenCVFromExtern>::ExternReceive, ) -> Self
Source§fn into_raw(
self,
) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self, ) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(
&self,
) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSend
fn as_raw( &self, ) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(
&mut self,
) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <LogisticRegression as OpenCVTypeExternContainer>::ExternSendMut
Source§impl Debug for LogisticRegression
impl Debug 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
Source§impl From<LogisticRegression> for StatModel
impl From<LogisticRegression> for StatModel
Source§fn from(s: LogisticRegression) -> Self
fn from(s: LogisticRegression) -> Self
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<()>
Source§fn set_train_method(&mut self, val: i32) -> Result<()>
fn set_train_method(&mut self, val: i32) -> Result<()>
Source§fn set_mini_batch_size(&mut self, val: i32) -> Result<()>
fn set_mini_batch_size(&mut self, val: i32) -> Result<()>
Source§fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
fn set_term_criteria(&mut self, val: TermCriteria) -> Result<()>
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>
Source§fn get_train_method(&self) -> Result<i32>
fn get_train_method(&self) -> Result<i32>
Source§fn get_mini_batch_size(&self) -> Result<i32>
fn get_mini_batch_size(&self) -> Result<i32>
Source§fn get_term_criteria(&self) -> Result<TermCriteria>
fn get_term_criteria(&self) -> Result<TermCriteria>
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>
Source§fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
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>
Source§fn train_with_data_def(&mut self, train_data: &Ptr<TrainData>) -> Result<bool>
fn train_with_data_def(&mut self, train_data: &Ptr<TrainData>) -> Result<bool>
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>
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>
fn empty(&self) -> Result<bool>
Source§fn is_trained(&self) -> Result<bool>
fn is_trained(&self) -> Result<bool>
Source§fn is_classifier(&self) -> Result<bool>
fn is_classifier(&self) -> Result<bool>
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>
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>
Source§fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
fn predict_def(&self, samples: &impl ToInputArray) -> Result<f32>
Source§impl TryFrom<StatModel> for LogisticRegression
impl TryFrom<StatModel> for LogisticRegression
impl Send for LogisticRegression
Auto Trait Implementations§
impl Freeze for LogisticRegression
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
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more