Overview
Samay provides comprehensive evaluation metrics for time series forecasting, covering both point forecasts and probabilistic predictions. All metrics are implemented insrc/samay/metric.py.
Metric Categories
Forecasting Metrics
These metrics measure the accuracy of point forecasts (mean predictions):MSE
Mean Squared Error
Measures average squared difference between predictions and ground truth.
Measures average squared difference between predictions and ground truth.
MAE
Mean Absolute Error
Measures average absolute difference. Less sensitive to outliers than MSE.
Measures average absolute difference. Less sensitive to outliers than MSE.
RMSE
Root Mean Squared Error
Square root of MSE. Same units as original data.
Square root of MSE. Same units as original data.
MASE
Mean Absolute Scaled Error
Scaled error metric comparing to naive baseline.
Scaled error metric comparing to naive baseline.
MAPE
Mean Absolute Percentage Error
Error as a percentage of true values.
Error as a percentage of true values.
SMAPE
Symmetric MAPE
Symmetric version of MAPE, bounded between 0 and 2.
Symmetric version of MAPE, bounded between 0 and 2.
NRMSE
Normalized RMSE
RMSE normalized by the range of true values.
RMSE normalized by the range of true values.
ND
Normalized Deviation
MAE normalized by the mean of true values.
MAE normalized by the mean of true values.
Probabilistic Metrics
These metrics evaluate the quality of quantile forecasts and prediction intervals:CRPS
Continuous Ranked Probability Score
Measures the accuracy of probabilistic forecasts across all quantiles.
Measures the accuracy of probabilistic forecasts across all quantiles.
MWSQ
Mean Weighted Squared Quantile Loss
Squared pinball loss across quantiles.
Squared pinball loss across quantiles.
MSIS
Mean Scaled Interval Score
Scores prediction interval width and coverage.
Scores prediction interval width and coverage.
Metric Signatures
Point Forecast Metrics
MSE
MAE
RMSE
MASE
MAPE
SMAPE
NRMSE
ND
Probabilistic Metrics
CRPS
MWSQ
MSIS
Evaluation Patterns
Using evaluate() Method
All models provide anevaluate() method that computes all metrics:
Getting Predictions with Metrics
Setmetric_only=False to also retrieve predictions:
Manual Metric Computation
You can also compute metrics manually:Evaluation Implementation Example
Here’s howevaluate() is implemented in TimesfmModel:
Metric Selection Guide
When to use MSE/RMSE
When to use MSE/RMSE
Best for:
- Penalizing large errors heavily
- Optimization objectives (differentiable)
- Gaussian-distributed errors
- Data contains outliers (use MAE instead)
- Errors have different scales across series
When to use MAE
When to use MAE
Best for:
- Robust to outliers
- Interpretable error magnitude
- When all errors should be weighted equally
- Same units as original data
- Less sensitive to extreme values than MSE
When to use MASE
When to use MASE
Best for:
- Comparing across datasets with different scales
- Benchmarking against naive forecasts
- Interpretable performance (MASE < 1 means better than naive)
- MASE < 1: Better than naive forecast
- MASE = 1: Same as naive forecast
- MASE > 1: Worse than naive forecast
When to use MAPE/SMAPE
When to use MAPE/SMAPE
Best for:
- Percentage-based interpretation
- Scale-independent comparison
- Business metrics
- Data contains zeros or near-zeros
- Asymmetric error tolerance (use SMAPE for symmetry)
When to use CRPS
When to use CRPS
Best for:
- Evaluating probabilistic forecasts
- Quantile forecast quality
- Uncertainty quantification
- Proper scoring rule
- Evaluates entire predictive distribution
- Reduces to MAE for point forecasts
Best Practices
Multiple Metrics
Always report multiple metrics for comprehensive evaluation:Denormalization
Always denormalize before computing metrics:Quantile Coverage
Use a good range of quantiles for probabilistic metrics:Next Steps
Models
Learn about model evaluation methods
Quickstart
See evaluation in action