pub trait MLModel {
// Required methods
fn get_health_metrics(&self) -> HashMap<String, f64>;
fn train(&mut self, data: &[u8]) -> AnyaResult<()>;
fn predict(&self, input: &[u8]) -> AnyaResult<Vec<u8>>;
fn evaluate(&self, test_data: &[u8]) -> AnyaResult<f64>;
}Expand description
ML Model trait for machine learning models in the system
Required Methods§
fn get_health_metrics(&self) -> HashMap<String, f64>
Sourcefn train(&mut self, data: &[u8]) -> AnyaResult<()>
fn train(&mut self, data: &[u8]) -> AnyaResult<()>
Train the model with the given data
Sourcefn evaluate(&self, test_data: &[u8]) -> AnyaResult<f64>
fn evaluate(&self, test_data: &[u8]) -> AnyaResult<f64>
Evaluate the model performance