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§
Sourcefn train(&mut self, data: &PredictionHistory) -> SklResult<()>
fn train(&mut self, data: &PredictionHistory) -> SklResult<()>
Train the model with historical data
Sourcefn predict(&self, context: &PredictionContext) -> SklResult<ResourcePrediction>
fn predict(&self, context: &PredictionContext) -> SklResult<ResourcePrediction>
Make a prediction
Sourcefn update(
&mut self,
actual: &ResourceUsage,
predicted: &ResourcePrediction,
) -> SklResult<()>
fn update( &mut self, actual: &ResourceUsage, predicted: &ResourcePrediction, ) -> SklResult<()>
Update model with new data