Skip to main content

select_model

Function select_model 

Source
pub fn select_model(
    timestamps: &[i64],
    values: &[f64],
    horizon: usize,
    options: &AutoForecastOptions,
) -> Result<ModelSelection, ForecastError>
Expand description

Choose a forecast model for a series by rolling-origin cross-validation.

What is fitted, and why the winner is chosen by out-of-sample error rather than by an information criterion, is described on AutoForecastOptions and SelectionMetric.

§Errors

ForecastError::InsufficientData when the series is too short to hold a training window and one horizon-long test window, and ForecastError::NumericalInstability when no candidate could be scored.