pub trait StatModelTrait: AlgorithmTrait + StatModelTraitConst {
    // Required method
    fn as_raw_mut_StatModel(&mut self) -> *mut c_void;

    // Provided methods
    fn train_with_data(
        &mut self,
        train_data: &Ptr<TrainData>,
        flags: i32
    ) -> Result<bool> { ... }
    fn train_with_data_def(
        &mut self,
        train_data: &Ptr<TrainData>
    ) -> Result<bool> { ... }
    fn train(
        &mut self,
        samples: &impl ToInputArray,
        layout: i32,
        responses: &impl ToInputArray
    ) -> Result<bool> { ... }
}
Expand description

Mutable methods for crate::ml::StatModel

Required Methods§

Provided Methods§

source

fn train_with_data( &mut self, train_data: &Ptr<TrainData>, flags: i32 ) -> Result<bool>

Trains the statistical model

Parameters
  • trainData: training data that can be loaded from file using TrainData::loadFromCSV or created with TrainData::create.
  • flags: optional flags, depending on the model. Some of the models can be updated with the new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP).
C++ default parameters
  • flags: 0
source

fn train_with_data_def(&mut self, train_data: &Ptr<TrainData>) -> Result<bool>

Trains the statistical model

Parameters
  • trainData: training data that can be loaded from file using TrainData::loadFromCSV or created with TrainData::create.
  • flags: optional flags, depending on the model. Some of the models can be updated with the new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP).
Note

This alternative version of [train_with_data] function uses the following default values for its arguments:

  • flags: 0
source

fn train( &mut self, samples: &impl ToInputArray, layout: i32, responses: &impl ToInputArray ) -> Result<bool>

Trains the statistical model

Parameters
  • samples: training samples
  • layout: See ml::SampleTypes.
  • responses: vector of responses associated with the training samples.

Object Safety§

This trait is not object safe.

Implementors§