pub trait MLModel:
Debug
+ Send
+ Sync {
// Required methods
fn train(&mut self, data: &[MLTrainingPoint]) -> Result<()>;
fn predict(&self, features: &[f64]) -> Result<f64>;
fn update(&mut self, point: &MLTrainingPoint) -> Result<()>;
fn name(&self) -> &str;
fn metrics(&self) -> ModelMetrics;
}Expand description
ML model trait
Required Methods§
Sourcefn train(&mut self, data: &[MLTrainingPoint]) -> Result<()>
fn train(&mut self, data: &[MLTrainingPoint]) -> Result<()>
Train the model with data
Sourcefn update(&mut self, point: &MLTrainingPoint) -> Result<()>
fn update(&mut self, point: &MLTrainingPoint) -> Result<()>
Update model with new data point
Sourcefn metrics(&self) -> ModelMetrics
fn metrics(&self) -> ModelMetrics
Get model metrics