Trait opencv::ml::TrainDataTrait

source ·
pub trait TrainDataTrait: TrainDataTraitConst {
    // Required method
    fn as_raw_mut_TrainData(&mut self) -> *mut c_void;

    // Provided methods
    fn set_train_test_split(&mut self, count: i32, shuffle: bool) -> Result<()> { ... }
    fn set_train_test_split_def(&mut self, count: i32) -> Result<()> { ... }
    fn set_train_test_split_ratio(
        &mut self,
        ratio: f64,
        shuffle: bool
    ) -> Result<()> { ... }
    fn set_train_test_split_ratio_def(&mut self, ratio: f64) -> Result<()> { ... }
    fn shuffle_train_test(&mut self) -> Result<()> { ... }
}
Expand description

Mutable methods for crate::ml::TrainData

Required Methods§

Provided Methods§

source

fn set_train_test_split(&mut self, count: i32, shuffle: bool) -> Result<()>

Splits the training data into the training and test parts

§See also

TrainData::setTrainTestSplitRatio

§C++ default parameters
  • shuffle: true
source

fn set_train_test_split_def(&mut self, count: i32) -> Result<()>

Splits the training data into the training and test parts

§See also

TrainData::setTrainTestSplitRatio

§Note

This alternative version of TrainDataTrait::set_train_test_split function uses the following default values for its arguments:

  • shuffle: true
source

fn set_train_test_split_ratio( &mut self, ratio: f64, shuffle: bool ) -> Result<()>

Splits the training data into the training and test parts

The function selects a subset of specified relative size and then returns it as the training set. If the function is not called, all the data is used for training. Please, note that for each of TrainData::getTrain* there is corresponding TrainData::getTest*, so that the test subset can be retrieved and processed as well.

§See also

TrainData::setTrainTestSplit

§C++ default parameters
  • shuffle: true
source

fn set_train_test_split_ratio_def(&mut self, ratio: f64) -> Result<()>

Splits the training data into the training and test parts

The function selects a subset of specified relative size and then returns it as the training set. If the function is not called, all the data is used for training. Please, note that for each of TrainData::getTrain* there is corresponding TrainData::getTest*, so that the test subset can be retrieved and processed as well.

§See also

TrainData::setTrainTestSplit

§Note

This alternative version of TrainDataTrait::set_train_test_split_ratio function uses the following default values for its arguments:

  • shuffle: true
source

fn shuffle_train_test(&mut self) -> Result<()>

Object Safety§

This trait is not object safe.

Implementors§