Sensitivity plus specificity minus one, at the threshold that maximises it. This is the metric species distribution modelling reports, and the one the shipped presence-absence response is scored by.
Details
A cut may only fall between distinct predictions: units sharing a prediction are decided
together, so the same score comes back whatever order they arrived in. A cell holding only
presences or only absences has no skill to measure and returns NA rather than a number.
The threshold is chosen on the same units the score is then read on, which is how the metric is
defined in the literature and how it is defined here, and it inflates the level where presences
are thin. tss_inflation() measures that inflation for a given design, and it cancels in the
paired differences paired_contrast() takes. Given a threshold learned elsewhere, the score
is read at that cut instead, which is what select_grain() reports under threshold = with a
cut learned on the inner folds.