MMMPlotSuite.cv_predictions#
- MMMPlotSuite.cv_predictions(results, dims=None)[source]#
Plot posterior predictive predictions across CV folds.
Generates visualization showing posterior predictive distributions for each cross-validation fold, with separate panels for different dimension combinations.
- 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 filter when plotting. 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 Array of axes objects, one per panel.
- fig
- Raises:
TypeErrorIf
resultsis not anarviz.InferenceDataobject.ValueErrorIf required groups or variables are missing from
results. If unsupported dimensions are specified indims.
See also
TimeSliceCrossValidator.runGenerate the combined InferenceData.
param_stabilityPlot parameter stability across folds.
cv_crpsPlot CRPS scores across folds.
Notes
The plot shows:
HDI (94%) for train (blue) and test (orange) ranges as shaded bands
Observed values as black lines
A vertical dashed green line marking the end of training for each fold