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.

chronos_model

Chronos foundation model implementation for time series forecasting.

ChronosModel

chronos_model.ChronosModel · inherits BaseModel

Chronos foundation model wrapper for time series forecasting.

This class provides a unified interface for the Amazon Chronos model, which is a large language model specifically designed for time series forecasting.

Attributes: * model_size: Size of the Chronos model ('tiny', 'mini', 'small', 'base', 'large') * context_length: Number of past time steps used as context * num_samples: Number of predictive samples to generate

__init__(self, params, settings)

Initialize the Chronos model wrapper.

Parameter Type Default Description
params Dict[str, Any] - Model parameters dictionary
settings Dict[str, Any] - Settings dictionary containing device, python_version, etc.

train(self, y_context, y_target, timestamps_context, timestamps_target, **kwargs) -> ChronosModel

Initialize the Chronos model (no training required for foundation models).

Parameters:

Parameter Type Default Description
y_context np.ndarray - Past target values (not used for training, for compatibility)
y_target np.ndarray - Future target values (not used for training, for compatibility)
timestamps_context np.ndarray - Timestamps for y_context (not used)
timestamps_target np.ndarray - Timestamps for y_target (not used)
**kwargs - Additional keyword arguments

Returns: Self (The model instance).

predict(self, y_context, timestamps_context, timestamps_target, **kwargs) -> np.ndarray

Make predictions using the trained Chronos model.

Parameters:

Parameter Type Default Description
y_context np.ndarray - Recent target values for context
timestamps_context np.ndarray - Timestamps for context data
timestamps_target np.ndarray - Timestamps for target data
**kwargs - Additional keyword arguments

Returns: np.ndarray (Model predictions).

Raises: * ValueError: If model is not fitted or required data is missing.