Trait ReductionImpl

Source
pub trait ReductionImpl:
    Send
    + Serialize
    + Deserialize {
    // Required methods
    fn predict(
        &self,
        features: &mut Features<'_>,
        depth_info: &mut DepthInfo,
        model_offset: ModelIndex,
    ) -> Prediction;
    fn learn(
        &mut self,
        features: &mut Features<'_>,
        label: &Label,
        depth_info: &mut DepthInfo,
        model_offset: ModelIndex,
    );
    fn children(&self) -> Vec<&ReductionWrapper>;

    // Provided methods
    fn predict_then_learn(
        &mut self,
        features: &mut Features<'_>,
        label: &Label,
        depth_info: &mut DepthInfo,
        model_offset: ModelIndex,
    ) -> Prediction { ... }
    fn sensitivity(
        &self,
        features: &Features<'_>,
        label: f32,
        prediction: f32,
        weight: f32,
        depth_info: DepthInfo,
    ) -> f32 { ... }
}

Required Methods§

Source

fn predict( &self, features: &mut Features<'_>, depth_info: &mut DepthInfo, model_offset: ModelIndex, ) -> Prediction

Source

fn learn( &mut self, features: &mut Features<'_>, label: &Label, depth_info: &mut DepthInfo, model_offset: ModelIndex, )

Source

fn children(&self) -> Vec<&ReductionWrapper>

Provided Methods§

Source

fn predict_then_learn( &mut self, features: &mut Features<'_>, label: &Label, depth_info: &mut DepthInfo, model_offset: ModelIndex, ) -> Prediction

Source

fn sensitivity( &self, features: &Features<'_>, label: f32, prediction: f32, weight: f32, depth_info: DepthInfo, ) -> f32

Trait Implementations§

Source§

impl<'typetag> Serialize for dyn ReductionImpl + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn ReductionImpl + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn ReductionImpl + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn ReductionImpl + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§