Chronos2Forecaster#
- class openstef_foundation_models.models.forecasting.Chronos2Forecaster(*, quantiles: list[~openstef_core.types.Quantile] = [0.5], horizons: list[~openstef_core.types.LeadTime], supports_batching: bool = True, backend: ~openstef_foundation_models.inference.backend.InferenceBackend, hyperparams: ~openstef_foundation_models.models.forecasting.chronos2_forecaster.Chronos2HyperParams = <factory>)[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:
- 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.- Overrides:
Forecaster.hparams
- property is_fitted: bool
Check if the predictor has been fitted.
- Overrides:
Predictor.is_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.
- Return type:
- Overrides:
Predictor.fit
- predict(data: ForecastInputDataset) ForecastDataset[source]
Forecast a single series.
- Parameters:
data (
ForecastInputDataset) – Input dataset whose target history provides the model context.- Return type:
- Returns:
Probabilistic forecast for the requested quantiles and horizon.
- Overrides:
Predictor.predict
- 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.- Return type:
BatchResult[ForecastDataset]- Returns:
One forecast per input dataset, in the same order.
- Overrides:
BatchPredictor.predict_batch
- 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].