Expand description
The filter’s numbers, aggregate only: how much ham it would call spam and how much spam it would catch at your two thresholds, each with its 95 % exact binomial interval (Clopper–Pearson), the share it calls unsure, and the area under the ROC curve. Nothing here names a message: these numbers may be read by an AI agent, so no subject, sender or word ever enters them.
Structs§
- AtThreshold
- What one threshold does: messages at or above it are called spam.
- Numbers
- The evaluation of probabilities against labels.
- Share
countofof, with its 95 % interval.
Constants§
- STRICT
- The share of ham a strict threshold may call spam: one in two hundred.
Functions§
- at
- What one threshold does to
(probability of spam, is spam)pairs. - auc
- The area under the ROC curve: the chance a random spam scores above a random ham (ties count half), by ranks (Mann–Whitney).
- beta_
fraction 🔒 - The continued fraction of the incomplete beta function (modified Lentz).
- beta_
quantile 🔒 - The x where the Beta(a, b) distribution reaches
p, by bisection. - clopper_
pearson - The exact (Clopper–Pearson) interval of
ksuccesses inntrials. - evaluate
- Evaluates
(probability of spam, is spam)pairs at the two thresholds. - grid
- The same at each of
thresholds, so that a threshold can be chosen (sioul spam eval’s grid): what each would set aside, and catch. - incomplete_
beta 🔒 - The regularized incomplete beta function I_x(a, b), by its continued
fraction (Numerical Recipes,
betai), with the symmetry for large x. - ln_
gamma 🔒 - ln Γ(x) for x > 0 (Lanczos, g = 7, nine terms).
- strict
- The lowest threshold at which at most
rateof the ham is called spam: just above the score of the ham that would be one too many. None without ham.