seismometer.plot.mpl.cohort_evaluation_vs_threshold

seismometer.plot.mpl.cohort_evaluation_vs_threshold(stats, cohort_feature, *, splits=None, labels=None, highlight=None)

Creates a 2x3 grid of individual performance metrics across cohorts.

Plots include Sensitivity, Flag Rate, PPV, Specificity, NPV vs Thresholds. Includes a legend with cohort size.

Parameters:
  • stats (pd.DataFrame) – Table of performance metrics, of the form given by calculate_bin_stats.

  • cohort_feature (str) – Display string for the cohort groupings.

  • splits (Optional[list], optional) – Primarily for non-categorical cohort info, a subset of cohort values to plot, by default None; plots all.

  • labels (Optional[list[str]], optional) – Optional list of display labels for cohorts, by default None; uses the cohort category value.

  • highlight (Optional[list[float]], optional) – An optional list of thresholds to highlight on the plots, by default None.

Return type:

Figure