probly.visualization.efficiency.plot_coverage_efficiency

Plotting for Coverage and Efficiency metrics.

Classes

CoverageEfficiencyVisualizer()

Class to visualize the trade-off between coverage and set size (efficiency).

class probly.visualization.efficiency.plot_coverage_efficiency.CoverageEfficiencyVisualizer[source]

Bases: object

Class to visualize the trade-off between coverage and set size (efficiency).

plot_coverage_efficiency(probs, targets, title='Coverage vs. Efficiency', ax=None)[source]

Create a dual-axis plot showing Coverage and Efficiency over Confidence Levels.

Parameters:
  • probs (np.ndarray) – Array of predicted probabilities with shape (n_samples, n_classes).

  • targets (np.ndarray) – True labels as a 1D array of shape (n_samples,).

  • title (str) – Plot title. Defaults to “Coverage vs. Efficiency”.

  • ax (Axes | None) – Matplotlib Axes to draw the plot on. If None, a new figure and axes are created.

Returns:

Matplotlib Axes containing the coverage-efficiency plot.

Return type:

Axes