Skip to main content

SampleDescription

Trait SampleDescription 

Source
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§

Source

type ThetaSplit: Clone

Type used to parametrize split features

Source

type ThetaLeaf: Clone

Type used to parametrize leaf predictors

Source

type Feature: PartialOrd + SampleRange + SplitBetween

Type of a split feature

Source

type Target

Source

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§

Source

fn target(&self) -> Self::Target

Get target value of sample

Source

fn sample_as_split_feature(&self, theta: &Self::ThetaSplit) -> Self::Feature

Compute the value of a leaf feature for a given sample

Source

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".

Implementors§

Source§

impl<'a, X, Y> SampleDescription for forester::api::extra_trees_regressor::Sample<'a, X, Y>

Source§

impl<'a, X, Y> SampleDescription for forester::api::extra_trees_classifier::Sample<'a, X, Y>