pub struct RandomForestClassifierParameters {
pub criterion: SplitCriterion,
pub max_depth: Option<u16>,
pub min_samples_leaf: usize,
pub min_samples_split: usize,
pub n_trees: u16,
pub m: Option<usize>,
pub keep_samples: bool,
pub seed: u64,
}
Expand description
Parameters of the Random Forest algorithm. Some parameters here are passed directly into base estimator.
Fields§
§criterion: SplitCriterion
Split criteria to use when building a tree. See Decision Tree Classifier
max_depth: Option<u16>
Tree max depth. See Decision Tree Classifier
min_samples_leaf: usize
The minimum number of samples required to be at a leaf node. See Decision Tree Classifier
min_samples_split: usize
The minimum number of samples required to split an internal node. See Decision Tree Classifier
n_trees: u16
The number of trees in the forest.
m: Option<usize>
Number of random sample of predictors to use as split candidates.
keep_samples: bool
Whether to keep samples used for tree generation. This is required for OOB prediction.
seed: u64
Seed used for bootstrap sampling and feature selection for each tree.
Implementations§
source§impl RandomForestClassifierParameters
impl RandomForestClassifierParameters
sourcepub fn with_criterion(self, criterion: SplitCriterion) -> Self
pub fn with_criterion(self, criterion: SplitCriterion) -> Self
Split criteria to use when building a tree. See Decision Tree Classifier
sourcepub fn with_max_depth(self, max_depth: u16) -> Self
pub fn with_max_depth(self, max_depth: u16) -> Self
Tree max depth. See Decision Tree Classifier
sourcepub fn with_min_samples_leaf(self, min_samples_leaf: usize) -> Self
pub fn with_min_samples_leaf(self, min_samples_leaf: usize) -> Self
The minimum number of samples required to be at a leaf node. See Decision Tree Classifier
sourcepub fn with_min_samples_split(self, min_samples_split: usize) -> Self
pub fn with_min_samples_split(self, min_samples_split: usize) -> Self
The minimum number of samples required to split an internal node. See Decision Tree Classifier
sourcepub fn with_n_trees(self, n_trees: u16) -> Self
pub fn with_n_trees(self, n_trees: u16) -> Self
The number of trees in the forest.
sourcepub fn with_m(self, m: usize) -> Self
pub fn with_m(self, m: usize) -> Self
Number of random sample of predictors to use as split candidates.
sourcepub fn with_keep_samples(self, keep_samples: bool) -> Self
pub fn with_keep_samples(self, keep_samples: bool) -> Self
Whether to keep samples used for tree generation. This is required for OOB prediction.
Trait Implementations§
source§impl Clone for RandomForestClassifierParameters
impl Clone for RandomForestClassifierParameters
source§fn clone(&self) -> RandomForestClassifierParameters
fn clone(&self) -> RandomForestClassifierParameters
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more