Skip to main content

DecisionPath

Trait DecisionPath 

Source
pub trait DecisionPath:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn explain(&self) -> String;
    fn feature_contributions(&self) -> &[f32];
    fn confidence(&self) -> f32;
    fn to_bytes(&self) -> Vec<u8> ;
    fn from_bytes(bytes: &[u8]) -> Result<Self, PathError>
       where Self: Sized;
}
Expand description

Common interface for all decision paths

Required Methods§

Source

fn explain(&self) -> String

Human-readable explanation

Source

fn feature_contributions(&self) -> &[f32]

Feature importance scores (contribution of each feature)

Source

fn confidence(&self) -> f32

Confidence in this decision (0.0 - 1.0)

Source

fn to_bytes(&self) -> Vec<u8>

Compact binary representation

Source

fn from_bytes(bytes: &[u8]) -> Result<Self, PathError>
where Self: Sized,

Reconstruct from binary representation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§