Skip to main content

TrainedModel

Trait TrainedModel 

Source
pub trait TrainedModel: Send + Sync {
    // Required methods
    fn predict(&self, features: &CodeFeatures) -> f64;
    fn save(&self, path: &Path) -> Result<()>;
    fn metadata(&self) -> ModelMetadata;
}
Expand description

Trained model that can be saved/loaded

Required Methods§

Source

fn predict(&self, features: &CodeFeatures) -> f64

Predict bug probability for features

Source

fn save(&self, path: &Path) -> Result<()>

Save model to file

§Errors

Returns IO error if save fails

Source

fn metadata(&self) -> ModelMetadata

Model version/metadata

Implementors§