[][src]Trait opencv::ml::SVMSGD

pub trait SVMSGD: StatModel {
    fn as_raw_SVMSGD(&self) -> *mut c_void;

    fn get_weights(&mut self) -> Result<Mat> { ... }
fn get_shift(&mut self) -> Result<f32> { ... }
fn set_optimal_parameters(
        &mut self,
        svmsgd_type: i32,
        margin_type: i32
    ) -> Result<()> { ... }
fn get_svmsgd_type(&self) -> Result<i32> { ... }
fn set_svmsgd_type(&mut self, svmsgd_type: i32) -> Result<()> { ... }
fn get_margin_type(&self) -> Result<i32> { ... }
fn set_margin_type(&mut self, margin_type: i32) -> Result<()> { ... }
fn get_margin_regularization(&self) -> Result<f32> { ... }
fn set_margin_regularization(
        &mut self,
        margin_regularization: f32
    ) -> Result<()> { ... }
fn get_initial_step_size(&self) -> Result<f32> { ... }
fn set_initial_step_size(&mut self, initial_step_size: f32) -> Result<()> { ... }
fn get_step_decreasing_power(&self) -> Result<f32> { ... }
fn set_step_decreasing_power(
        &mut self,
        step_decreasing_power: f32
    ) -> Result<()> { ... }
fn get_term_criteria(&self) -> Result<TermCriteria> { ... }
fn set_term_criteria(&mut self, val: &TermCriteria) -> Result<()> { ... } }


Stochastic Gradient Descent SVM Classifier *

Required methods

Loading content...

Provided methods

fn get_weights(&mut self) -> Result<Mat>

Returns

the weights of the trained model (decision function f(x) = weights * x + shift).

fn get_shift(&mut self) -> Result<f32>

Returns

the shift of the trained model (decision function f(x) = weights * x + shift).

fn set_optimal_parameters(
    &mut self,
    svmsgd_type: i32,
    margin_type: i32
) -> Result<()>

Function sets optimal parameters values for chosen SVM SGD model.

Parameters

  • svmsgdType: is the type of SVMSGD classifier.
  • marginType: is the type of margin constraint.

C++ default parameters

  • svmsgd_type: SVMSGD::ASGD
  • margin_type: SVMSGD::SOFT_MARGIN

fn get_svmsgd_type(&self) -> Result<i32>

@see setSvmsgdType

fn set_svmsgd_type(&mut self, svmsgd_type: i32) -> Result<()>

@copybrief getSvmsgdType @see getSvmsgdType

fn get_margin_type(&self) -> Result<i32>

@see setMarginType

fn set_margin_type(&mut self, margin_type: i32) -> Result<()>

@copybrief getMarginType @see getMarginType

fn get_margin_regularization(&self) -> Result<f32>

@see setMarginRegularization

fn set_margin_regularization(
    &mut self,
    margin_regularization: f32
) -> Result<()>

@copybrief getMarginRegularization @see getMarginRegularization

fn get_initial_step_size(&self) -> Result<f32>

@see setInitialStepSize

fn set_initial_step_size(&mut self, initial_step_size: f32) -> Result<()>

@copybrief getInitialStepSize @see getInitialStepSize

fn get_step_decreasing_power(&self) -> Result<f32>

@see setStepDecreasingPower

fn set_step_decreasing_power(
    &mut self,
    step_decreasing_power: f32
) -> Result<()>

@copybrief getStepDecreasingPower @see getStepDecreasingPower

fn get_term_criteria(&self) -> Result<TermCriteria>

@see setTermCriteria

fn set_term_criteria(&mut self, val: &TermCriteria) -> Result<()>

@copybrief getTermCriteria @see getTermCriteria

Loading content...

Methods

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

pub fn create() -> Result<PtrOfSVMSGD>[src]

Creates empty model. Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to find the best parameters for your problem or use setOptimalParameters() to set some default parameters.

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

Loads and creates a serialized SVMSGD from a file

Use SVMSGD::save to serialize and store an SVMSGD to disk. Load the SVMSGD 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 SVMSGD
  • nodeName: name of node containing the classifier

C++ default parameters

  • node_name: String()

Implementors

impl SVMSGD for PtrOfSVMSGD[src]

Loading content...