Trait forester::data::SampleDescription
[−]
[src]
pub trait SampleDescription { type ThetaSplit; type ThetaLeaf; type Feature: PartialOrd + SampleRange; type Prediction; fn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature; fn sample_predict(&self, w: &Self::ThetaLeaf) -> Self::Prediction; }
Data sample used with decision trees
Associated Types
type ThetaSplit
Type used to parametrize split features
type ThetaLeaf
Type used to parametrize leaf predictors
type Feature: PartialOrd + SampleRange
Type of a split feature
type Prediction
Type of predicted values; this can be the same as Self::Y
(e.g. regression) or something
different (e.g. class probabilities).
Required Methods
fn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature
Compute the value of a leaf feature for a given sample
fn sample_predict(&self, w: &Self::ThetaLeaf) -> Self::Prediction
Compute the leaf prediction for a given sample
Implementors
impl<'a, X, Y> SampleDescription for forester::api::extra_trees_regressor::Sample<'a, X, Y> where
X: Clone + PartialOrd + SampleRange, type ThetaSplit = usize; type ThetaLeaf = f64; type Feature = X; type Prediction = f64;impl<'a, X, Y> SampleDescription for forester::api::extra_trees_classifier::Sample<'a, X, Y> where
X: Clone + PartialOrd + SampleRange, type ThetaSplit = usize; type ThetaLeaf = ClassCounts; type Feature = X; type Prediction = ClassCounts;