Forecaster
MantisForecaster
Forecaster using Mantis time-series foundation model embeddings.
Quickstart
python
from sktime.forecasting.mantis import MantisForecaster
estimator = MantisForecaster(checkpoint='paris-noah/MantisV2', model_version='v2', context_length=512, seq_len=512, regressor=None, batch_size=256, device='auto', ignore_deps=False)Parameters(7)
- checkpointstr or None, default=”paris-noah/MantisV2”
Hugging Face checkpoint to load via Mantis
from_pretrained. If None, use a randomly initialized Mantis backbone.- model_version{“v1”, “v2”}, default=”v2”
- Mantis architecture version. Use “v1” for “paris-noah/Mantis-8M” and “paris-noah/MantisPlus”; use “v2” for “paris-noah/MantisV2”.
- context_lengthint, default=512
- Number of most recent observations used for each supervised window.
- seq_lenint, default=512
Length passed to Mantis. If different from
context_length, windows are resized with linear interpolation.- regressorsklearn regressor or None, default=None
Regression model trained on Mantis embeddings. If None,
Ridge()is used.- batch_sizeint, default=256
- Batch size for Mantis embedding extraction.
- devicestr, default=”auto”
- Torch device. If “auto”, use CUDA when available, otherwise CPU.
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.mantis import MantisForecaster
>>> y = load_airline ()
>>> forecaster = MantisForecaster (context_length = 24)
>>> forecaster. fit (y) MantisForecaster(
... )
>>> y_pred = forecaster. predict (fh = [1, 2, 3 ])References
- [1 ] Feofanov et al., “Mantis: Lightweight Calibrated Foundation Model for User-Friendly Time Series Classification”, 2025. https://arxiv.org/abs/2502.15637