22 unstable releases (8 breaking)

0.10.1 Sep 8, 2025
0.10.0 May 19, 2025
0.9.0 Jan 14, 2025
0.8.0 Dec 23, 2024
0.3.1 Jul 30, 2024

#855 in Algorithms

Download history 165/week @ 2025-09-22 85/week @ 2025-09-29 190/week @ 2025-10-06 210/week @ 2025-10-13 305/week @ 2025-10-20 180/week @ 2025-10-27 41/week @ 2025-11-03 143/week @ 2025-11-10 372/week @ 2025-11-17 207/week @ 2025-11-24 441/week @ 2025-12-01 201/week @ 2025-12-08 302/week @ 2025-12-15 294/week @ 2025-12-22 544/week @ 2025-12-29 526/week @ 2026-01-05

1,685 downloads per month
Used in 3 crates (via augurs)

MIT/Apache

95KB
2K SLoC

High level forecasting API for augurs

augurs-forecaster contains a high-level API for training and predicting with time series models. It currently allows you to combine a model with a set of transformations (such as imputation of missing data, min-max scaling, and log/logit transforms) and fit the model on the transformed data, automatically handling back-transformation of forecasts and prediction intervals.

Usage

First add this crate and any required model crates to your Cargo.toml:

[dependencies]
augurs-ets = { version = "*", features = ["mstl"] }
augurs-forecaster = "*"
augurs-mstl = "*"
use augurs::{
    ets::{AutoETS, trend::AutoETSTrendModel},
    forecaster::{
        Forecaster, Transformer,
        transforms::{LinearInterpolator, Logit, MinMaxScaler},
    },
    mstl::MSTLModel
};

let data = &[
    1.0, 1.2, 1.4, 1.5, f64::NAN, 1.4, 1.2, 1.5, 1.6, 2.0, 1.9, 1.8
];

// Set up the model. We're going to use an MSTL model to handle
// multiple seasonalities, with a non-seasonal `AutoETS` model
// for the trend component.
// We could also use any model that implements `augurs_core::Fit`.
let ets = AutoETS::non_seasonal().into_trend_model();
let mstl = MSTLModel::new(vec![2], ets);

// Set up the transformers.
let transformers = vec![
    LinearInterpolator::new().boxed(),
    MinMaxScaler::new().boxed(),
    Logit::new().boxed(),
];

// Create a forecaster using the transforms.
let mut forecaster = Forecaster::new(mstl).with_transformers(transformers);

// Fit the forecaster. This will transform the training data by
// running the transforms in order, then fit the MSTL model.
forecaster.fit(&data).expect("model should fit");

// Generate some in-sample predictions with 95% prediction intervals.
// The forecaster will handle back-transforming them onto our original scale.
let in_sample = forecaster
    .predict_in_sample(0.95)
    .expect("in-sample predictions should work");

// Similarly for out-of-sample predictions:
let out_of_sample = forecaster
    .predict(5, 0.95)
    .expect("out-of-sample predictions should work");

Dependencies

~3MB
~64K SLoC