MMMPlotSuite.cv_crps#
- MMMPlotSuite.cv_crps(results, dims=None)[source]#
Plot CRPS scores for train and test sets across CV splits.
Generates plots showing the Continuous Ranked Probability Score (CRPS) for each cross-validation fold, optionally stratified by additional dimensions.
- Parameters:
- results
arviz.InferenceData Combined InferenceData produced by
TimeSliceCrossValidator.run(). Must contain:A coordinate named ‘cv’
A ‘cv_metadata’ group with per-fold metadata (X_train, y_train, X_test, y_test) stored under
cv_metadata.metadataA posterior_predictive group containing ‘y_original_scale’
- dims
dict, optional Dictionary specifying dimensions to stratify the CRPS computation. Keys must be coordinates present on
posterior_predictive['y_original_scale']. Values can be single values or lists of values.
- results
- Returns:
- fig
matplotlib.figure.Figure The matplotlib figure object.
- axes
numpy.ndarrayofmatplotlib.axes.Axes 2D array of axes objects with shape (n_panels, 2), where the first column shows train CRPS and the second shows test CRPS.
- fig
- Raises:
TypeErrorIf
resultsis not anarviz.InferenceDataobject.ValueErrorIf required groups or variables are missing from
results. If no ‘cv’ coordinate is found in the InferenceData.
See also
TimeSliceCrossValidator.runGenerate the combined InferenceData.
cv_predictionsPlot posterior predictive across folds.
param_stabilityPlot parameter stability across folds.
Notes
CRPS (Continuous Ranked Probability Score) is a proper scoring rule that measures the quality of probabilistic predictions. Lower values indicate better predictions.