#[non_exhaustive]pub struct RandomForestRegressor { /* private fields */ }Expand description
Random Forest for regression (mean of tree predictions).
Implementations§
Source§impl RandomForestRegressor
impl RandomForestRegressor
Sourcepub fn n_estimators(self, n: usize) -> Self
pub fn n_estimators(self, n: usize) -> Self
Set number of trees.
Sourcepub fn max_features(self, mf: MaxFeatures) -> Self
pub fn max_features(self, mf: MaxFeatures) -> Self
Set feature selection strategy.
Sourcepub fn predict(&self, features: &[Vec<f64>]) -> Result<Vec<f64>>
pub fn predict(&self, features: &[Vec<f64>]) -> Result<Vec<f64>>
Predict values (mean across trees).
Parallelized across samples via rayon.
Sourcepub fn feature_importances(&self) -> Result<Vec<f64>>
pub fn feature_importances(&self) -> Result<Vec<f64>>
Feature importances.
Sourcepub fn trees(&self) -> &[DecisionTreeRegressor]
pub fn trees(&self) -> &[DecisionTreeRegressor]
Get individual trees (for inspection or ONNX export).
Sourcepub fn n_features(&self) -> usize
pub fn n_features(&self) -> usize
Number of features the model was trained on.
Trait Implementations§
Source§impl Clone for RandomForestRegressor
impl Clone for RandomForestRegressor
Source§fn clone(&self) -> RandomForestRegressor
fn clone(&self) -> RandomForestRegressor
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 RandomForestRegressor
impl Default for RandomForestRegressor
Auto Trait Implementations§
impl Freeze for RandomForestRegressor
impl RefUnwindSafe for RandomForestRegressor
impl Send for RandomForestRegressor
impl Sync for RandomForestRegressor
impl Unpin for RandomForestRegressor
impl UnsafeUnpin for RandomForestRegressor
impl UnwindSafe for RandomForestRegressor
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