Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

Chronos2Model

chronax.models.chronos2_model.Chronos2Model · inherits BaseModel

Chronos-2 foundation model wrapper with native covariate support.

Chronos-2 supports past-only and known future covariates. When covariates are provided, they are passed to the model. When not provided, forecasting uses only the target series (same as Chronos).

__init__(self, params: Dict[str, Any], settings: Dict[str, Any])

Initializes the Chronos-2 model wrapper.

Parameter Type Default Description
params Dict[str, Any] - (undocumented)
settings Dict[str, Any] - (undocumented)

Raises: ImportError: If chronos-forecasting>=2.0 is not installed.

train(self, y_context: np.ndarray, y_target: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> "Chronos2Model"

Initialize Chronos-2 (no training required for foundation models).

Parameter Type Default Description
y_context np.ndarray - (undocumented)
y_target np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - (undocumented)

Returns: Self (the initialized model).

predict(self, y_context: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> np.ndarray

Make predictions using Chronos-2. Uses covariates when provided.

Parameter Type Default Description
y_context np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - (undocumented)

Returns: np.ndarray (Forecast samples of shape (num_samples, forecast_horizon, num_targets)).