Skip to content

Eval Bench

Model evaluation and threshold economics.

Model Evaluation & Threshold Economics

LIVEsynthetic data · generator disclosed

A logistic model was just trained in your browser (300 gradient-descent epochs) on a seeded synthetic fraud corpus of 1,200 transactions (148 fraudulent, base rate 12%). The generative process is in evalbench.ts — nothing here is a canned figure. The question this lab answers: where do you set the decision threshold, in dollars?

ROC AUC
0.954

ranking quality across all thresholds

PR AUC
0.835

vs 12% base rate

Brier score
0.046

probability quality (lower is better)

Cost-optimal threshold
0.11

$5,436 total operating cost

ROC curve

Area 0.954 — computed from 1,201 distinct score thresholds

Precision / recall

Average precision 0.835 — the honest curve at a 12% base rate

Calibration

Reliability by decile · Brier 0.046 — do 0.8 scores mean 80%?

Threshold economics

Every flag buys a review; every miss eats a loss. The U-curve picks the operating point.

optimum t = 0.11 · $5,436

Operate the threshold

Drag the bar; the confusion matrix and the bill move together.

threshold = 0.50
85
fraud caught (TP)
16
false alarms (FP)
63
fraud missed (FN)
1036
clean passed (TN)
precision / recall here0.84 / 0.57
review bill (101 flags × $8)$808
missed-fraud losses (63 × $420)$26,460
total at t = 0.50$27,268
vs cost-optimal t = 0.11$5,436

Visible math: score = σ(w·x + b), trained by full-batch gradient descent (L2 = 1e-3). ROC sweeps every distinct score; AUC is the trapezoid sum. Total cost(t) = flags(t) × review cost + misses(t) × fraud loss. Data is synthetic and seeded (mulberry32, seed 7) with two pure-noise features — the generative process ships in the same tested module as these formulas (@labs/engines/evalbench).