pod.plot_model_selection

plot_model_selection(cv_scores, used_key=None, cv_winner_key=None)

Generates a normalized bar chart of the Bias-Variance Tradeoff from CV scores, alongside a sorted table of the exact MSE values in best-fit order.

Bars are colour-coded to distinguish the CV winner, the user-forced model (when different from the CV winner), and all other candidates.

Parameters

Name Type Description Default
cv_scores dict Dictionary mapping (model_type, params) tuples to their Cross-Validation MSE scores. required
used_key tuple | None The (type, params) key of the model that was actually used for the PoD calculation. If None, the bar with the lowest MSE is treated as the used model. None
cv_winner_key tuple | None The (type, params) key of the CV winner. If None, falls back to the bar with the lowest MSE. None

Examples

fig = plot_model_selection(
    model.cv_scores_,
    used_key=('Polynomial', 5),
    cv_winner_key=model.cv_winner_
)