Visualize CV scores
- plot_utils.visualize_cv_scores(fig=None, ax=None, dpi=100, n_folds=5, cv_scores=None, box_height=0.6, box_width=0.9, gap_frac=0.05, metric_name='AUC', avg_cv_score=None, no_holdout_set=False, holdout_score=None, fontsize=9, flip_yaxis=True)[source]
Visualize K-fold cross-validation scores as well as hold-out set performance in an intuitive way.
- Parameters:
fig (matplotlib.figure.Figure or
None
) – Figure object. If None, a new figure will be created.ax (matplotlib.axes._subplots.AxesSubplot or
None
) – Axes object. If None, a new axes will be created.dpi (float) – Figure resolution. The dpi of
fig
(if notNone
) will override this parameter.n_folds (int) – Number of CV folds.
cv_scores (list<float> or
None
) – The validation score of each fold. IfNone
, no scores will be shown on the small boxes.box_height (float) – The height of the the small box, in inches.
box_width (float) – The width of the small box, in inches.
gap_frac (float) – How much gap should there be between each small box.
metric_name (str) – The name of the metric to be shown in the figure.
avg_cv_score (float or
None
) – The average cross-validation score. IfNone
(recommended), it will be calculated by numpy.mean(cv_scores).no_holdout_set (bool) – If
False
, the hold-out data set will be visualized alongside the training data set. This parameter supersedesholdout_score
.holdout_score (float or
None
) – The performance on the hold-out data set. Ifno_holdout_set
isTrue
, this parameter has no effect.fontsize (float) – The font size of all the texts.
flip_yaxis (bool) – If
True
, everything will be flipped upside down. This parameter is for diagnosis and and debugging purpose only. It is recommended to leave it asTrue
.
- Returns:
fig (matplotlib.figure.Figure) – The figure object being created or being passed into this function.
ax (matplotlib.axes._subplots.AxesSubplot) – The axes object being created or being passed into this function.