Plot performance across classification thresholds
Source:R/plotting.R
plot_threshold_performance.RdSensitivity, specificity, and TSS as the probability cutoff moves from 0 to 1, with the TSS-maximising cutoff marked.
Arguments
- predictions
the
predictionselement of afit_patch_model()result- path
where to write a PNG;
NULLreturns the plot instead
Details
The metrics table reports sensitivity and specificity at the default 0.5 cut, which is rarely the right one for imbalanced data — the original pipeline binarised its projections at a ROC-derived cutoff for exactly this reason. This shows what the trade-off looks like across the whole range, and where it is best balanced.