pub struct DecisionTreeBuilder<State> { /* private fields */ }Expand description
Builder pattern for configuring DecisionTree
Implementations§
Source§impl<State> DecisionTreeBuilder<State>
impl<State> DecisionTreeBuilder<State>
Sourcepub fn criterion(self, criterion: SplitCriterion) -> Self
pub fn criterion(self, criterion: SplitCriterion) -> Self
Set the split criterion
Sourcepub fn min_samples_split(self, min_samples_split: usize) -> Self
pub fn min_samples_split(self, min_samples_split: usize) -> Self
Set the minimum samples required to split an internal node
Sourcepub fn min_samples_leaf(self, min_samples_leaf: usize) -> Self
pub fn min_samples_leaf(self, min_samples_leaf: usize) -> Self
Set the minimum samples required to be at a leaf node
Sourcepub fn min_impurity_decrease(self, min_impurity_decrease: f64) -> Self
pub fn min_impurity_decrease(self, min_impurity_decrease: f64) -> Self
Set the minimum impurity decrease required for a split
Sourcepub fn max_features(self, _max_features: Option<usize>) -> Self
pub fn max_features(self, _max_features: Option<usize>) -> Self
Set the maximum number of features to consider for splitting
Sourcepub fn random_state(self, random_state: Option<u64>) -> Self
pub fn random_state(self, random_state: Option<u64>) -> Self
Set the random seed
Sourcepub fn build(self) -> DecisionTree<State>
pub fn build(self) -> DecisionTree<State>
Build the DecisionTree with the configured parameters
Trait Implementations§
Source§impl<State: Debug> Debug for DecisionTreeBuilder<State>
impl<State: Debug> Debug for DecisionTreeBuilder<State>
Auto Trait Implementations§
impl<State> Freeze for DecisionTreeBuilder<State>
impl<State> RefUnwindSafe for DecisionTreeBuilder<State>where
State: RefUnwindSafe,
impl<State> Send for DecisionTreeBuilder<State>where
State: Send,
impl<State> Sync for DecisionTreeBuilder<State>where
State: Sync,
impl<State> Unpin for DecisionTreeBuilder<State>where
State: Unpin,
impl<State> UnwindSafe for DecisionTreeBuilder<State>where
State: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more