Class Signature
ChronosBoltModel class implements Chronos-Bolt, an optimized version of Amazon’s Chronos designed for faster inference in production environments while maintaining forecasting accuracy.
Initialization Parameters
Model configuration dictionary. Used when initializing a new model without pre-trained weights.
Hugging Face model repository ID. If provided, loads the pre-trained Chronos-Bolt model. If not provided, initializes a new model using the config.
Methods
finetune()
Dataset for finetuning. Call
get_data_loader() to get the dataloader.Optional keyword arguments (currently uses default hyperparameters: lr=1e-4, epochs=10).
The model is finetuned in-place.
evaluate()
Dataset for evaluation. Use
get_data_loader() to obtain the dataloader.Forecast horizon length.
Quantile levels used to compute quantile forecasts and scoring metrics (e.g., [0.1, 0.5, 0.9]).
If True, return only a dict of metrics. If False, return metrics plus arrays.
When
metric_only=True:Dictionary containing:mse: Mean Squared Errormae: Mean Absolute Errormase: Mean Absolute Scaled Errormape: Mean Absolute Percentage Errorrmse: Root Mean Squared Errornrmse: Normalized RMSEsmape: Symmetric Mean Absolute Percentage Errormsis: Mean Scaled Interval Scorend: Normalized Deviationmwsq: Mean Weighted Scaled Quantile Losscrps: Continuous Ranked Probability Score
metric_only=False:Tuple of (metrics, trues, preds, histories, quantile_forecasts):metrics: Dictionary of metrics (as above)trues: Ground truth valuespreds: Mean predictionshistories: Input context sequencesquantile_forecasts: Quantile forecasts
plot()
Dataset for plotting.
Forecast horizon length.
List of quantile levels to request from the model (e.g., [0.1, 0.5, 0.9]).
This method does not return a value. It displays visualizations.
Usage Example
Notes
- Chronos-Bolt is optimized for faster inference compared to standard Chronos
- Uses the same T5-based architecture with performance optimizations
- Ideal for production deployments requiring low latency
- Supports variable-length context and prediction horizons