MLModel

Trait MLModel 

Source
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§

Source

fn get_health_metrics(&self) -> HashMap<String, f64>

Source

fn train(&mut self, data: &[u8]) -> AnyaResult<()>

Train the model with the given data

Source

fn predict(&self, input: &[u8]) -> AnyaResult<Vec<u8>>

Predict using the trained model

Source

fn evaluate(&self, test_data: &[u8]) -> AnyaResult<f64>

Evaluate the model performance

Implementors§