Chronos2Forecaster#
- class openstef_foundation_models.models.forecasting.Chronos2Forecaster(**data: Any) None[source]
Bases:
ForecasterZero-shot probabilistic forecaster backed by a Chronos-2 checkpoint.
The forecaster composes an
InferenceBackend(built once and reused across an entire backtest) and translates between OpenSTEF datasets and the model’s tensor interface. Prediction is batch-first:predict_batch()runs the backend once over a stack of series andpredict()is a batch-of-one wrapper.- Parameters:
data (
Any)
- HyperParams
alias of
Chronos2HyperParams
- backend: InferenceBackend
- hyperparams: Chronos2HyperParams
- supports_batching: bool
- property hparams: Chronos2HyperParams
Model hyperparameters for training and prediction.
Concrete forecasters implement this by returning their narrowed
hyperparamsfield, giving callers a polymorphic read-only view while each subclass keeps full type safety on its own field.
- property is_fitted: bool
Check if the predictor has been fitted.
- fit(data: ForecastInputDataset, data_val: ForecastInputDataset | None = None) None[source]
Fit the forecaster.
Chronos-2 is pretrained and zero-shot, so there is nothing to fit. The method exists only to satisfy the forecaster contract.
- Parameters:
data (
ForecastInputDataset) – Unused training data.data_val (
ForecastInputDataset|None) – Unused validation data.data
data_val
- Return type:
- predict(data: ForecastInputDataset) ForecastDataset[source]
Forecast a single series.
- Parameters:
data (
ForecastInputDataset) – Input dataset whose target history provides the model context.data
- Returns:
Probabilistic forecast for the requested quantiles and horizon.
- Return type:
- predict_batch(data: list[ForecastInputDataset]) BatchResult[ForecastDataset][source]
Forecast a batch of series in a single backend call.
- Parameters:
data (
list[ForecastInputDataset]) – Input datasets to forecast. Each provides its own target history and forecast start.data
- Returns:
One forecast per input dataset, in the same order.
- Return type:
GenericAlias[ForecastDataset]
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].