pub trait SampleDescription {
type ThetaSplit: Clone;
type ThetaLeaf: Clone;
type Feature: PartialOrd + SampleRange + SplitBetween;
type Target;
type Prediction;
// Required methods
fn target(&self) -> Self::Target;
fn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature;
fn sample_predict(&self, w: &Self::ThetaLeaf) -> Self::Prediction;
}Expand description
Data sample used with decision trees
Required Associated Types§
Sourcetype ThetaSplit: Clone
type ThetaSplit: Clone
Type used to parametrize split features
Sourcetype Feature: PartialOrd + SampleRange + SplitBetween
type Feature: PartialOrd + SampleRange + SplitBetween
Type of a split feature
type Target
Sourcetype Prediction
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§
Sourcefn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature
fn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature
Compute the value of a leaf feature for a given sample
Sourcefn sample_predict(&self, w: &Self::ThetaLeaf) -> Self::Prediction
fn sample_predict(&self, w: &Self::ThetaLeaf) -> Self::Prediction
Compute the leaf prediction for a given sample
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".