Classification Trade-offs Mini-Lab - Nidhal Selmi

Model and evaluation

This mini-lab shows common classification metrics and trade-offs using a simplified 2D binary classifier. Real positives (+) are sampled from an isotropic bivariate Gaussian centered at the origin and conditioned on radius ≤ 5. Real negatives (−) are sampled uniformly by area from the surrounding annulus. The σ control reports underlying → visible coordinate standard deviation. The classifier predicts positive inside its movable circular boundary and negative outside it. Glyph sign and hue encode the true class.

Every interaction recomputes the confusion matrix, complementary error rates, predictive values, aggregate scores, likelihood ratios, and correlation measures. The density cross-section exposes the class geometry at y = 0. ROC and precision–recall curves sweep all decision radii and mark the selected operating point; the prevalence stress test isolates how class balance changes accuracy, precision, and F1 while TPR and FPR remain fixed.

Use it to showcase threshold trade-offs, base-rate effects, class imbalance, distribution overlap, boundary misspecification, and finite-sample variability.

Population

Population geometry

Classifier

truncated Gaussian + · uniform annulus − · cross-section y = 0
+ real positive − real negative lighter = inside / predicted + decision boundary visible σ annulus inner

Live evaluation

Real \ predictedPositiveNegative
PositiveTP FN
NegativeFP TN
More metrics (11)

Threshold and prevalence analysis

ROC curveAUC

threshold sweep● current radius random

Precision–recall curvePR-AUC

threshold sweep● current radius prevalence

Prevalence stress testcurrent

accuracy precision F1

Sweeps prevalence while holding the current TPR and FPR fixed.