PredictionModel

Trait PredictionModel 

Source
pub trait PredictionModel:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn train(&mut self, data: &PredictionHistory) -> SklResult<()>;
    fn predict(
        &self,
        context: &PredictionContext,
    ) -> SklResult<ResourcePrediction>;
    fn accuracy(&self) -> f64;
    fn update(
        &mut self,
        actual: &ResourceUsage,
        predicted: &ResourcePrediction,
    ) -> SklResult<()>;
}
Expand description

Prediction model trait

Required Methods§

Source

fn name(&self) -> &str

Model name

Source

fn train(&mut self, data: &PredictionHistory) -> SklResult<()>

Train the model with historical data

Source

fn predict(&self, context: &PredictionContext) -> SklResult<ResourcePrediction>

Make a prediction

Source

fn accuracy(&self) -> f64

Get model accuracy

Source

fn update( &mut self, actual: &ResourceUsage, predicted: &ResourcePrediction, ) -> SklResult<()>

Update model with new data

Implementors§