pub trait StatModel: AlgorithmTrait + StatModelConst {
    fn as_raw_mut_StatModel(&mut self) -> *mut c_void;

    fn train_with_data(
        &mut self,
        train_data: &Ptr<dyn TrainData>,
        flags: i32
    ) -> Result<bool> { ... } fn train(
        &mut self,
        samples: &dyn ToInputArray,
        layout: i32,
        responses: &dyn ToInputArray
    ) -> Result<bool> { ... } }

Required Methods

Provided Methods

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

Trains the statistical model

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

Implementors