Back to models
Forecaster

TafsutForecaster

Zero-shot probabilistic forecaster using the Tafsut foundation model.

Tafsut is a univariate, probabilistic time-series foundation model. It returns forecasts at nine quantile levels from 0.1 through 0.9 and does not support exogenous variables or in-sample predictions.

Quickstart

python
from sktime.forecasting.tafsut import TafsutForecaster

estimator = TafsutForecaster(model_path: str | None='Tafsut-FM/tafsut-univariate-base', config: dict | None=None, device=None)

Parameters(3)

model_pathstr or None, default=”Tafsut-FM/tafsut-univariate-base”

Local model directory or Hugging Face model repository identifier. If None, initialize a random model from config.

configdict, optional

Configuration values for a model initialized with model_path=None.

devicestr or torch.device, optional

Device used for inference. If None, Tafsut selects CUDA when available and CPU otherwise.

Examples

>>> import pandas as pd
>>> from sktime.forecasting.tafsut import TafsutForecaster
>>> config = {
... "context_length": 8,
... "prediction_length": 4,
... "input_patch_size": 2,
... "output_patch_size": 2,
... "input_patch_stride": 2,
... "d_model": 8,
... "d_kv": 2,
... "d_ff": 16,
... "num_layers": 1,
... "num_heads": 4,
... "dropout_rate": 0.0,
... }
>>> forecaster = TafsutForecaster (
... model_path = None, config = config, device = "cpu"
... )
>>> y = pd. Series (range (8))
>>> _ = forecaster. fit (y, fh = [1, 2, 3, 4 ])
>>> y_pred = forecaster. predict ()