#[non_exhaustive]pub struct DecisionTreeRegressor { /* private fields */ }Expand description
CART decision tree for regression.
Implementations§
Source§impl DecisionTreeRegressor
impl DecisionTreeRegressor
Sourcepub fn min_samples_split(self, n: usize) -> Self
pub fn min_samples_split(self, n: usize) -> Self
Set minimum samples required to split.
Sourcepub fn min_samples_leaf(self, n: usize) -> Self
pub fn min_samples_leaf(self, n: usize) -> Self
Set minimum samples required in a leaf.
Sourcepub fn max_features(self, n: usize) -> Self
pub fn max_features(self, n: usize) -> Self
Set maximum features per split (for random forest).
Sourcepub fn ccp_alpha(self, alpha: f64) -> Self
pub fn ccp_alpha(self, alpha: f64) -> Self
Set cost-complexity pruning parameter.
Subtrees with effective alpha ≤ ccp_alpha are pruned after
tree construction. A value of 0.0 (default) disables pruning.
Larger values produce smaller, more regularized trees.
Sourcepub fn feature_importances(&self) -> Result<Vec<f64>>
pub fn feature_importances(&self) -> Result<Vec<f64>>
Feature importances.
Sourcepub fn n_features(&self) -> usize
pub fn n_features(&self) -> usize
Number of features.
Trait Implementations§
Source§impl Clone for DecisionTreeRegressor
impl Clone for DecisionTreeRegressor
Source§fn clone(&self) -> DecisionTreeRegressor
fn clone(&self) -> DecisionTreeRegressor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for DecisionTreeRegressor
impl Default for DecisionTreeRegressor
Auto Trait Implementations§
impl Freeze for DecisionTreeRegressor
impl RefUnwindSafe for DecisionTreeRegressor
impl Send for DecisionTreeRegressor
impl Sync for DecisionTreeRegressor
impl Unpin for DecisionTreeRegressor
impl UnsafeUnpin for DecisionTreeRegressor
impl UnwindSafe for DecisionTreeRegressor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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