pub trait TimeSeriesModelTrait:
Debug
+ Send
+ Sync {
// Required methods
fn fit(&mut self, data: &Array2<f64>, targets: &Array2<f64>) -> Result<()>;
fn predict(&self, data: &Array2<f64>, horizon: usize) -> Result<Array2<f64>>;
fn parameters(&self) -> &Array1<f64>;
fn update_parameters(&mut self, params: &Array1<f64>) -> Result<()>;
fn clone_box(&self) -> Box<dyn TimeSeriesModelTrait>;
fn model_type(&self) -> &'static str;
// Provided method
fn complexity(&self) -> usize { ... }
}Expand description
Trait for time series models
Required Methods§
Sourcefn fit(&mut self, data: &Array2<f64>, targets: &Array2<f64>) -> Result<()>
fn fit(&mut self, data: &Array2<f64>, targets: &Array2<f64>) -> Result<()>
Fit the model to training data
Sourcefn predict(&self, data: &Array2<f64>, horizon: usize) -> Result<Array2<f64>>
fn predict(&self, data: &Array2<f64>, horizon: usize) -> Result<Array2<f64>>
Predict future values
Sourcefn parameters(&self) -> &Array1<f64>
fn parameters(&self) -> &Array1<f64>
Get model parameters
Sourcefn clone_box(&self) -> Box<dyn TimeSeriesModelTrait>
fn clone_box(&self) -> Box<dyn TimeSeriesModelTrait>
Clone the model
Sourcefn model_type(&self) -> &'static str
fn model_type(&self) -> &'static str
Model type name
Provided Methods§
Sourcefn complexity(&self) -> usize
fn complexity(&self) -> usize
Get model complexity (parameter count)