Opproplot

Binary classifier operating profile plots

View the Project on GitHub rollingstorms/opproplot

API Reference

compute_operating_profile

from opproplot import compute_operating_profile
profile = compute_operating_profile(y_true, y_score, bins=40, score_range=(0, 1))

Returns an OperatingProfile dataclass with:

operating_profile_plot

from opproplot import operating_profile_plot
fig, ax_hist, ax_metric = operating_profile_plot(
    y_true,
    y_score,
    bins=30,
    show_accuracy=True,
    show_key=True,
    key_location="inside",
    show_grid=False,
    title=None,
)

Returns (fig, ax_hist, ax_metric) for further styling or saving.