sage.plotting.calibration_curve

Filename : calibration_curve.py Description : Short description of the file

Created on 2026-03-21 17:43:40

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Functions

plot_calibration_curve(epoch, ranking_stat, labels[, ...])

Plot model calibration: predicted ranking-statistic bins vs signal fraction.

Module Contents

plot_calibration_curve(epoch, ranking_stat, labels, export_dir=None, save=True, nbins=20)[source]

Plot model calibration: predicted ranking-statistic bins vs signal fraction.

Bins the ranking statistic and plots the mean predicted score against the actual fraction of signals in each bin. A well-calibrated model should follow the diagonal.

Parameters:
  • epoch (int or str) – Epoch identifier for the title and filename.

  • ranking_stat (array-like, shape (N,)) – Predicted ranking statistics.

  • labels (array-like, shape (N,)) – Binary ground-truth labels (1 = signal, 0 = noise).

  • export_dir (str or None) – Output directory (saves under root as calibration_curve_{epoch}.png).

  • save (bool) – If True, save to disk; otherwise display interactively.

  • nbins (int) – Number of bins for the calibration curve (default 20).