ChronosTinyModel
chronos_tiny_model.ChronosTinyModel · 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 documented in source:
* 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. |
fit(self, y_context, y_target, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> ChronosTinyModel
Initialize the Chronos model (no training required for foundation models). This method just marks the model as ready for inference.
| 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)
Raises:
* RuntimeError: If model settings request device=cuda but torch.cuda is not available.
* ValueError: If an unsupported Chronos device is requested.
predict(self, y_context, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> np.ndarray
Make predictions using the trained Chronos model.
| 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