pub struct RandomForestClassifier { /* private fields */ }
Expand description
Random forest classifier.
Implementations§
Source§impl RandomForestClassifier
impl RandomForestClassifier
Sourcepub fn fit<T: ClassificationCriterion>(criterion: T, table: Table<'_>) -> Self
pub fn fit<T: ClassificationCriterion>(criterion: T, table: Table<'_>) -> Self
Builds a classifier model fitting the given table with the default settings.
Sourcepub fn predict(&self, features: &[f64]) -> f64
pub fn predict(&self, features: &[f64]) -> f64
Predicts the target value for the given features.
Sourcepub fn predict_individuals<'a>(
&'a self,
features: &'a [f64],
) -> impl 'a + Iterator<Item = f64>
pub fn predict_individuals<'a>( &'a self, features: &'a [f64], ) -> impl 'a + Iterator<Item = f64>
Returns an iterator that iterates over a target value predicted by each decision tree.
Sourcepub fn serialize<W: Write>(&self, writer: W) -> Result<()>
pub fn serialize<W: Write>(&self, writer: W) -> Result<()>
Writes this classifier to the given byte stream.
Sourcepub fn deserialize<R: Read>(reader: R) -> Result<Self>
pub fn deserialize<R: Read>(reader: R) -> Result<Self>
Reads a classifier from the given byte stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RandomForestClassifier
impl RefUnwindSafe for RandomForestClassifier
impl Send for RandomForestClassifier
impl Sync for RandomForestClassifier
impl Unpin for RandomForestClassifier
impl UnwindSafe for RandomForestClassifier
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