plots.plot_set_size_vs_true_label

plots.plot_set_size_vs_true_label(
    prediction_sets,
    y_true,
    title='Set Size vs True Label',
)

Plot a stacked bar chart showing the distribution of true labels for each prediction set size.

Parameters

prediction_sets : list of lists

Each inner list is the prediction set for one sample.

y_true : list or np.array

True labels for each instance.

title : str = 'Set Size vs True Label'

Title of the plot.

Returns

fig : matplotlib.figure.Figure

The figure object.

ax : matplotlib.axes.Axes

The axes object.