sage.plotting.perturbation_sensitivity

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

Created on 2026-03-21 17:51:16

__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_perturbation_sensitivity(model, ranking_stat, ...)

Plot network output change when a source parameter is perturbed.

Module Contents

plot_perturbation_sensitivity(model, ranking_stat, labels, source_params, param_name, export_dir=None, save=True, perturb_frac=0.05, nbins=20, epoch=None)[source]

Plot network output change when a source parameter is perturbed.

For each signal event, increases and decreases param_name by perturb_frac × value, runs inference, and bins the output change by the original parameter value. Reveals how sensitively the network responds to small changes in each physical parameter.

Parameters:
  • model (object with predict method) – Trained model.

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

  • labels (array-like, shape (N,)) – Binary ground-truth labels.

  • source_params (dict[str, array-like]) – Per-event parameter arrays.

  • param_name (str) – Key of the parameter to perturb.

  • export_dir (str or None) – Output directory.

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

  • perturb_frac (float) – Fractional perturbation size (default 0.05).

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

  • epoch (int or str or None) – Epoch identifier for the filename.