PredictionProvider

Trait PredictionProvider 

Source
pub trait PredictionProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn predict(
        &self,
        features: &Array2<Float>,
        coefficients: &Array1<Float>,
        intercept: Option<Float>,
    ) -> Result<Array1<Float>>;
    fn name(&self) -> &'static str;

    // Provided methods
    fn predict_with_confidence(
        &self,
        features: &Array2<Float>,
        coefficients: &Array1<Float>,
        intercept: Option<Float>,
        confidence_level: Float,
    ) -> Result<PredictionWithConfidence> { ... }
    fn predict_with_uncertainty(
        &self,
        features: &Array2<Float>,
        coefficients: &Array1<Float>,
        intercept: Option<Float>,
    ) -> Result<PredictionWithUncertainty> { ... }
    fn supports_confidence_intervals(&self) -> bool { ... }
    fn supports_uncertainty_quantification(&self) -> bool { ... }
}
Expand description

Extensible prediction interface supporting different prediction types

Required Methods§

Source

fn predict( &self, features: &Array2<Float>, coefficients: &Array1<Float>, intercept: Option<Float>, ) -> Result<Array1<Float>>

Source

fn name(&self) -> &'static str

Get the name of this prediction provider

Provided Methods§

Source

fn predict_with_confidence( &self, features: &Array2<Float>, coefficients: &Array1<Float>, intercept: Option<Float>, confidence_level: Float, ) -> Result<PredictionWithConfidence>

Source

fn predict_with_uncertainty( &self, features: &Array2<Float>, coefficients: &Array1<Float>, intercept: Option<Float>, ) -> Result<PredictionWithUncertainty>

Prediction with uncertainty quantification (if supported)

Source

fn supports_confidence_intervals(&self) -> bool

Check if this provider supports confidence intervals

Source

fn supports_uncertainty_quantification(&self) -> bool

Check if this provider supports uncertainty quantification

Implementors§