pub trait MetaModel {
// Required methods
fn fit(&mut self, records: &[MetaTrainingRecord]);
fn is_fitted(&self) -> bool;
fn predict(&self, features: &CorpusFeatures) -> PipelineConfig;
fn name(&self) -> &str;
}Expand description
Predicts a PipelineConfig from a CorpusFeatures profile.
Implementers fit on a training set of MetaTrainingRecords (pairs
of (features, best_config) observed from past tuner runs) and predict
a config for a new corpus.
Required Methods§
Sourcefn fit(&mut self, records: &[MetaTrainingRecord])
fn fit(&mut self, records: &[MetaTrainingRecord])
Fit on a training set. Replacing any prior state.
Sourcefn is_fitted(&self) -> bool
fn is_fitted(&self) -> bool
True once fit has been called with at least one usable record.
Self::predict panics when this is false, so Result-returning
boundaries (e.g. SphereQLPipeline::new_from_metamodel) check
this first. No default impl on purpose: every model must answer
for its own notion of “fitted” rather than inherit a guess.
Sourcefn predict(&self, features: &CorpusFeatures) -> PipelineConfig
fn predict(&self, features: &CorpusFeatures) -> PipelineConfig
Predict the config that should work best on a corpus with the
given profile. Panics if fit has not been called with at least
one record — callers should treat MetaModel as a trained object
and front-load fit, or check Self::is_fitted when the
training state isn’t statically known.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".