roc_scores#

scio.eval.roc_scores(confs_ind, confs_ood, *, scores_and_layers=None, ood_title=None, legend=True, convex_hull=False, ax=None)[source]#

For a given OoD set, plot ROCs over all scores.

Parameters:
  • confs_ind (NDArray) – Confidence scores on In-Distribution data. Shape (n_scores, n_ind_samples).

  • confs_ood (NDArray) – Confidence scores on Out-of-Distribution data. Shape (n_scores, n_ood_samples).

  • scores_and_layers (Iterable[ScoreClassifAndLayers | str], optional) – See fit_scores() for ScoreClassifAndLayers elements. Scores (and layers) used to compute confs_* in compute_confidence(). Used only for legend purposes.

  • ood_title (str, optional) – Title of the OoD set related to confs_ood. Used only for the plot title.

  • legend (bool) – Whether or not to show legend. Defaults to True.

  • convex_hull (bool) – Whether to show the convex hull for each Pareto front. Defaults to False.

  • ax (plt.Axes, optional) – If provided, ROCs are plotted on this ax.

Returns:

ax (plt.Axes) – The matplotlib axes containing the plot.