Zurück zu den Modellen
Forecaster

Toto2Forecaster

Toto 2.0 foundation model forecaster for zero-shot forecasting.

Direct interface to the forecaster from DataDog/toto [1].

Toto 2.0 is the latest generation, featuring a u-μP-scaled transformer with alternating time/variate attention and quantile-based probabilistic forecasting. It supports zero-shot forecasting and can process multiple variables, generating both point forecasts and uncertainty estimates via a quantile head. It supports variable prediction horizons and context lengths.

Schnellstart

python
from sktime.forecasting.toto2 import Toto2Forecaster

estimator = Toto2Forecaster(model_path: str='Datadog/Toto-2.0-22m', decode_block_size: int | None=None, device: str | None=None, seed: int | None=None)

Parameter(4)

model_pathstr, optional (default=”Datadog/Toto-2.0-22m”)
Path to the Toto 2.0 HuggingFace model. Available checkpoints include “Datadog/Toto-2.0-4m”, “Datadog/Toto-2.0-22m”, “Datadog/Toto-2.0-313m”, “Datadog/Toto-2.0-1B”, and “Datadog/Toto-2.0-2.5B”.
decode_block_sizeint or None, optional (default=None)
Decoding strategy. None (single forward pass) is faster and best for short horizons (used for all leaderboard results). A value such as 768 (block decode) gives better long-term stability for horizons >~1000. If set, must be a multiple of the model’s patch size.
devicestr or None, optional (default=None)
Device on which to run the model (‘cpu’ or ‘cuda’). If None, uses ‘cuda’ when available, otherwise ‘cpu’.
seedint or None, optional (default=None)
Random seed for reproducibility; if None, a random seed is drawn.

Beispiele

>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.toto2 import Toto2Forecaster
>>> y = load_airline () Zero-shot forecasting with the default model:
>>> forecaster = Toto2Forecaster ()
>>> forecaster. fit (y)
>>> y_pred = forecaster. predict (fh = [1, 2, 3 ]) Probabilistic forecasting. Toto-2 emits a fixed quantile grid (0.1, …, 0.9); other levels come from a HistogramQPD (linear interpolation, clamped tails):
>>> forecaster = Toto2Forecaster (
... model_path = "Datadog/Toto-2.0-4m"
... )
>>> forecaster. fit (y)
>>> intervals = forecaster. predict_interval (
... fh = [1, 2, 3 ], coverage = 0.9
... ) Long-horizon forecasting with block decoding. Block decoding only engages when the horizon spans multiple patches (i.e. exceeds decode_block_size):
>>> forecaster = Toto2Forecaster (
... model_path = "Datadog/Toto-2.0-22m", decode_block_size = 768
... )
>>> forecaster. fit (y)
>>> y_pred = forecaster. predict (fh = list (range (1, 1001)))

Referenzen