plots.plot_nonconformity_scores

plots.plot_nonconformity_scores(
    y_calib,
    scores_calib,
    y_test,
    scores_test,
    qhat,
    title='Nonconformity Scores',
    palette=None,
)

Plot nonconformity scores for calibration and test sets, highlighting class and q̂ threshold.

Parameters

y_calib : array - like

True labels of the calibration set.

scores_calib : array - like

Nonconformity scores of the calibration set.

y_test : array - like

True labels of the test set.

scores_test : array - like

Nonconformity scores of the test set.

qhat : float

Quantile threshold (1 - alpha).

title : str = 'Nonconformity Scores'

Title of the plot.

palette : dict = None

Color mapping for class labels. Defaults to {0: “red”, 1: “cyan”}.

Returns

fig : matplotlib.figure.Figure

The figure object.

ax : matplotlib.axes.Axes

The axes object.