pub struct FittedRandomForestClassifier<F: Float> { /* private fields */ }Expand description
Fitted random forest classifier.
Implementations§
Source§impl<F: Float> FittedRandomForestClassifier<F>
impl<F: Float> FittedRandomForestClassifier<F>
Sourcepub fn feature_importances(&self) -> Array1<F>
pub fn feature_importances(&self) -> Array1<F>
Feature importances averaged across all trees and normalized to sum to 1.
Each tree’s importances are computed in its own (possibly reduced) feature space, then mapped back to the original feature indices and averaged.
Sourcepub fn n_estimators(&self) -> usize
pub fn n_estimators(&self) -> usize
Number of trees in the forest.
Sourcepub fn predict_proba(&self, x: &Array2<F>) -> Result<Array2<F>>
pub fn predict_proba(&self, x: &Array2<F>) -> Result<Array2<F>>
Predict class probabilities for each sample.
Returns an Array2<F> of shape (n_samples, n_classes) where each row
sums to 1.0. Probabilities are averaged across all trees in the forest.
Sourcepub fn oob_score(&self) -> Option<f64>
pub fn oob_score(&self) -> Option<f64>
OOB accuracy score (only available when oob_score=true and bootstrap=true).
Trait Implementations§
Source§impl<F: Clone + Float> Clone for FittedRandomForestClassifier<F>
impl<F: Clone + Float> Clone for FittedRandomForestClassifier<F>
Source§fn clone(&self) -> FittedRandomForestClassifier<F>
fn clone(&self) -> FittedRandomForestClassifier<F>
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<'de, F> Deserialize<'de> for FittedRandomForestClassifier<F>where
F: DeserializeOwned + Float,
impl<'de, F> Deserialize<'de> for FittedRandomForestClassifier<F>where
F: DeserializeOwned + Float,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F: Float> Predict<F> for FittedRandomForestClassifier<F>
impl<F: Float> Predict<F> for FittedRandomForestClassifier<F>
Source§impl<F: Float> PredictProba<F> for FittedRandomForestClassifier<F>
impl<F: Float> PredictProba<F> for FittedRandomForestClassifier<F>
Auto Trait Implementations§
impl<F> Freeze for FittedRandomForestClassifier<F>
impl<F> RefUnwindSafe for FittedRandomForestClassifier<F>where
F: RefUnwindSafe,
impl<F> Send for FittedRandomForestClassifier<F>
impl<F> Sync for FittedRandomForestClassifier<F>
impl<F> Unpin for FittedRandomForestClassifier<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedRandomForestClassifier<F>
impl<F> UnwindSafe for FittedRandomForestClassifier<F>where
F: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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