Skip to main content

Explainable

Trait Explainable 

Source
pub trait Explainable {
    type Path: DecisionPath;

    // Required methods
    fn predict_explained(
        &self,
        x: &[f32],
        n_samples: usize,
    ) -> (Vec<f32>, Vec<Self::Path>);
    fn explain_one(&self, sample: &[f32]) -> Self::Path;
}
Expand description

Trait for models that can explain their predictions

Required Associated Types§

Source

type Path: DecisionPath

Model-specific decision path type

Required Methods§

Source

fn predict_explained( &self, x: &[f32], n_samples: usize, ) -> (Vec<f32>, Vec<Self::Path>)

Predict with full decision trace for each sample

Source

fn explain_one(&self, sample: &[f32]) -> Self::Path

Single-sample explanation (for streaming)

Implementors§