Struct stamm::randforest::RandomForestLearnParam
[−]
[src]
pub struct RandomForestLearnParam<LearnF> where
LearnF: TreeLearnFunctions, { pub tree_param: TreeParameters, pub number_of_trees: usize, pub size_of_subset_per_training: usize, pub learn_function: LearnF, }
Parameter describes the way to train a random forest
Fields
tree_param: TreeParameters
parameter used for every tree
number_of_trees: usize
number of trees
size_of_subset_per_training: usize
size of a random training subset used for train one tree
learn_function: LearnF
TreeLearnFunction
Methods
impl<LearnF> RandomForestLearnParam<LearnF> where
LearnF: TreeLearnFunctions + Copy,
[src]
LearnF: TreeLearnFunctions + Copy,
pub fn new(
number_of_trees: usize,
size_of_subset_per_training: usize,
learnf: LearnF
) -> RandomForestLearnParam<LearnF>
[src]
number_of_trees: usize,
size_of_subset_per_training: usize,
learnf: LearnF
) -> RandomForestLearnParam<LearnF>
Creates a new RandomForestLearnParam.
number_of_trees
is the number of trees used in this random forest.
Every tree will be trained using a random subset of the training data. size_of_subset_per_training
is the size of this subset.
learnf
is the TreeLearnFunction for every tree
pub fn train_forest(
self,
train_set: &[(&LearnF::Data, &LearnF::Truth)]
) -> Option<RandomForest<LearnF::LeafParam, LearnF::PredictFunction>>
[src]
self,
train_set: &[(&LearnF::Data, &LearnF::Truth)]
) -> Option<RandomForest<LearnF::LeafParam, LearnF::PredictFunction>>
Trains a random forest using the ground truth data train_set
.
impl<LearnF> RandomForestLearnParam<LearnF> where
LearnF: TreeLearnFunctions + Copy + Send + Sync,
LearnF::PredictFunction: Send + Sync,
LearnF::Truth: Send + Sync,
LearnF::LeafParam: Send + Sync,
LearnF::Data: Send + Sync,
LearnF::Param: Send + Sync,
[src]
LearnF: TreeLearnFunctions + Copy + Send + Sync,
LearnF::PredictFunction: Send + Sync,
LearnF::Truth: Send + Sync,
LearnF::LeafParam: Send + Sync,
LearnF::Data: Send + Sync,
LearnF::Param: Send + Sync,
pub fn train_forest_parallel(
self,
train_set: &[(&LearnF::Data, &LearnF::Truth)]
) -> Option<RandomForest<LearnF::LeafParam, LearnF::PredictFunction>>
[src]
self,
train_set: &[(&LearnF::Data, &LearnF::Truth)]
) -> Option<RandomForest<LearnF::LeafParam, LearnF::PredictFunction>>
Like train_forest
but use rayon to parallelize the training.
Trait Implementations
Auto Trait Implementations
impl<LearnF> Send for RandomForestLearnParam<LearnF> where
LearnF: Send,
LearnF: Send,
impl<LearnF> Sync for RandomForestLearnParam<LearnF> where
LearnF: Sync,
LearnF: Sync,