plots.plot_prediction_set_profiles_by_feature

plots.plot_prediction_set_profiles_by_feature(
    feature_values,
    prediction_sets,
    y_true,
    bins=10,
    title='Prediction Set Profiles vs Feature Value',
    figsize=(12, 6),
)

Plot the percentage of prediction set types by binned values of a feature.

Parameters

feature_values : array-like of shape (n_samples,)

Feature values used to bin the data.

prediction_sets : list of list or set

Prediction sets for each instance.

y_true : array-like of shape (n_samples,)

True class labels.

bins : int or array - like = 10

Number of bins or custom bin edges.

title : str = "Prediction Set Profiles vs Feature Value"

Plot title.

figsize : tuple = (12, 6)

Figure size.

Returns

fig : matplotlib.figure.Figure

The figure object.

ax1 : matplotlib.axes.Axes

Primary axes object.

ax2 : matplotlib.axes.Axes

Secondary axes object (for sample count).

Examples

>>> fig, ax1, ax2 = plot_prediction_set_profiles_by_feature(
...     X_test["age"].values,
...     prediction_sets,
...     y_test
... )