Skip to main content

TimeSeriesModelTrait

Trait TimeSeriesModelTrait 

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

Source

fn fit(&mut self, data: &Array2<f64>, targets: &Array2<f64>) -> Result<()>

Fit the model to training data

Source

fn predict(&self, data: &Array2<f64>, horizon: usize) -> Result<Array2<f64>>

Predict future values

Source

fn parameters(&self) -> &Array1<f64>

Get model parameters

Source

fn update_parameters(&mut self, params: &Array1<f64>) -> Result<()>

Update parameters

Source

fn clone_box(&self) -> Box<dyn TimeSeriesModelTrait>

Clone the model

Source

fn model_type(&self) -> &'static str

Model type name

Provided Methods§

Source

fn complexity(&self) -> usize

Get model complexity (parameter count)

Trait Implementations§

Source§

impl Clone for Box<dyn TimeSeriesModelTrait>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§