pub struct RandomForest {
pub trees: Vec<TernaryDecisionTree>,
pub n_features_per_split: usize,
}Expand description
Random forest for ternary classification.
Fields§
§trees: Vec<TernaryDecisionTree>§n_features_per_split: usizeImplementations§
Source§impl RandomForest
impl RandomForest
pub fn new( n_trees: usize, max_depth: usize, min_samples: usize, n_features_per_split: usize, ) -> Self
pub fn fit(&mut self, samples: &[Sample])
pub fn predict(&self, features: &[Feature]) -> Ternary
Sourcepub fn feature_importance(
&self,
samples: &[Sample],
n_features: usize,
) -> Vec<f64>
pub fn feature_importance( &self, samples: &[Sample], n_features: usize, ) -> Vec<f64>
Compute feature importance via permutation.
pub fn accuracy(&self, samples: &[Sample]) -> f64
Trait Implementations§
Source§impl Clone for RandomForest
impl Clone for RandomForest
Source§fn clone(&self) -> RandomForest
fn clone(&self) -> RandomForest
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 moreAuto Trait Implementations§
impl Freeze for RandomForest
impl RefUnwindSafe for RandomForest
impl Send for RandomForest
impl Sync for RandomForest
impl Unpin for RandomForest
impl UnsafeUnpin for RandomForest
impl UnwindSafe for RandomForest
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