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: Dict[str, Any], settings: Dict[str, Any])

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: 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) -> 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)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - Additional keyword arguments

Returns: Self (The model instance).

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 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
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - Additional keyword arguments

Returns: np.ndarray (Model predictions). Raises: ValueError (If model is not fitted or required data is missing).