Class Signature
TimesFM_2p5_Model class implements TimesFM 2.5, the next generation of Google’s Time-Series Foundation Model with enhanced forecasting capabilities and improved accuracy.
Initialization Parameters
Model configuration dictionary using ForecastConfig parameters. Required for model compilation.
Hugging Face model repository ID. If provided, loads the pre-trained TimesFM 2.5 model. If not provided, initializes a new model instance.
Additional keyword arguments passed to the base class.
Properties
Quantile levels configured in the model, accessed from
model.model.config.quantiles.Methods
evaluate()
Dataset containing the input data and relevant functions like dataloaders.
If True, return only metrics. If False, return metrics plus arrays.
When
metric_only=True:Dictionary containing evaluation metrics: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):metrics: Dictionary containing evaluation metrics (as above)trues: True values of shape (batch_size, n_channels, horizon_len)preds: Predicted values of shape (batch_size, n_channels, horizon_len)histories: Historical context values of shape (batch_size, n_channels, context_len)
Usage Example
Notes
- TimesFM 2.5 requires a config dictionary with ForecastConfig parameters for model compilation
- The model must be compiled with
model.compile(config)after initialization - Supports probabilistic forecasting through quantile predictions
- Improved over TimesFM 1.0 with better accuracy and faster inference
- The model is evaluated in eval mode and moved to the appropriate device automatically
- Context length and horizon length are determined by the dataset configuration