HomeArtificial IntelligencePrecision vs Recall: Picking a Fraud Alert Threshold

Precision vs Recall: Picking a Fraud Alert Threshold

Last updated: December 6, 2026 · Metric definitions checked against the scikit-learn 1.9.1 documentation and the original papers on 6 December 2026. Numbers: DTF simulation of 1,000,000 synthetic card transactions (calc.py, fixed seed). Not financial or legal advice.

Precision is the share of your fraud alerts that turn out to be fraud: TP / (TP + FP). Recall is the share of all fraud that you alert on: TP / (TP + FN). Raising the alert threshold buys precision and costs recall. In fraud work, neither should be maximised on its own. Put a euro price on a missed fraud, an analyst review and a blocked good customer, then pick the threshold with the lowest total cost.

confusion matrixPR-AUCprecision at kalert threshold

The model report says 99.86% accuracy. Your manager likes that number. You know it is close to meaningless, because a model that never flags anything scores 99.80% on the same data. The real question on your desk is different: at what score do we raise an alert, and what will that choice cost us each day?

We built a test bench to answer it: a synthetic bank with 100,000 card payments a day, 0.2% of them fraud, and a logistic regression scoring every payment. The same model, unchanged, cost €18,276 a day at the default 0.5 threshold and €14,290 a day at a threshold of 0.12. That gap is about €1.45 million a year, with no retraining. For where the model itself fits in a fraud stack, see our guide to machine learning for fraud detection.

Precision and recall explained on one day of card payments

Every alerting rule sorts a day’s payments into four boxes, the confusion matrix. Here is our model at its cheapest threshold (0.12), as daily averages over a 10-day test period:

Per dayActually fraudActually legitimate
Alert raisedTrue positives: 102.7
€21,856 stopped; review €514
False positives: 78.4
review €392 + friction €1,176
No alertFalse negatives: 97.3
€12,208 lost
True negatives: 99,721.6
€0

Here is how to calculate precision and recall from those four boxes:

  • Precision = TP / (TP + FP) = 102.7 / 181.1 = 56.7%. Of the alerts your analysts open, 57 in 100 are real.
  • Recall (also called sensitivity or true positive rate) = TP / (TP + FN) = 102.7 / 200 = 51.4%. Of the fraud that happened, you flagged about half.
  • Specificity = TN / (TN + FP) = 99.92%, and the false positive rate is 0.08%. Both look superb and say almost nothing about the alert queue.

A mnemonic that sticks: precision looks at your alerts, recall looks at the fraud. Precision is the analyst’s question (“how much of my queue is junk?”). Recall is the loss manager’s question (“how much got past us?”).

One more line in that matrix matters. In euros, the alerts caught 64% of the fraud value, not 51%. The flagged cases were the expensive ones. That comes back later.

Why is my fraud model 99.8% accurate but useless?

Because accuracy rewards the 99.8% of payments that were never in question. With 200 frauds among 100,000 payments, “approve everything” is right 99,800 times. It is 99.80% accurate and lets €34,065 of fraud through every day. The ULB credit card dataset maintained by Andrea Dal Pozzolo and colleagues has 492 frauds in 284,807 European card transactions (0.17%), so the same trick scores 99.83% there.

Accuracy does not just flatter useless models; it points you to the wrong threshold. In our test, accuracy peaks at a threshold of 0.36 (99.87%), where the model costs €16,300 a day. The cost-optimal 0.12 scores a slightly lower 99.82% and costs €2,010 a day less. Charles Elkan put the logic in one sentence in his 2001 IJCAI paper on cost-sensitive learning: “it can be rational not to approve a large credit card transaction even if the transaction is most likely legitimate.” Accuracy cannot see that, because it prices every mistake at the same €1.

Should a bank optimise precision or recall?

Neither on its own: a bank should minimise expected cost, which lands somewhere between the two. That answer is older than machine learning. In the early 1960s Cyril Cleverdon’s Aslib Cranfield project tested library indexing systems, measuring “recall” and a “relevance ratio” that later became precision. Cleverdon wrote that “the inverse relationship between recall and relevance has been conclusively shown”. He added that in some settings “the emphasis must be on the highest possible recall level”, while in others “recall is less important”. A fraud team in 2026 lives in the same trade-off. The difference is that our errors have invoices attached.

Precision-recall curve with three candidate thresholdsPrecision-recall curve of a logistic regression on 1,000,000 synthetic card transactions with 0.2% fraud. PR-AUC (average precision) 0.5128; a random model would score 0.002. default 0.5: threshold 0.5, precision 0.9385, recall 0.328; max F1: threshold 0.237, precision 0.786, recall 0.4445; lowest € cost: threshold 0.1214, precision 0.5671, recall 0.5135; threshold 0.02: precision 0.1113, recall 0.6235.Precision-recall curve with three candidate thresholdsDecodeTheFuture.orgprecision-vs-recall-fraud-detectionChartimage/svg+xml© DecodeTheFuture.orgprecision (share of alerts that are fraud)0%0%25%25%50%50%75%75%100%100%random model: 0.2%default 0.5max F1 (0.24)lowest € cost (0.12)0.02: 1,120 alerts/dayrecall (share of fraud caught)
Precision-recall curve of one model on 1,000,000 test payments. Moving left to right lowers the threshold: more fraud caught, more junk in the queue. The dashed line is a random model (precision = fraud share = 0.2%). Source: DTF calculation (calc.py, seed 2026).

Three points on that curve tell the story. The default 0.5 threshold gives 94% precision and only 33% recall. It looks disciplined and leaves €17,862 a day on the table. The threshold that maximises F1 (0.24) gives 79% precision and 44% recall. The cheapest threshold (0.12) gives 57% and 51%. F1, the harmonic mean 2PR / (P + R), assumes precision and recall matter equally. In fraud they rarely do. Here, trusting F1 costs €684 a day, about €250,000 a year. F2, which weights recall more, happened to land on the cost optimum here. Treat that as luck.

How do I choose a threshold when alerts cost money?

Write down three prices, compute the total daily cost at every threshold and take the minimum. Our assumptions (yours will differ): a missed fraud costs its full amount, every alert costs €5 of analyst time, and every false alert adds €15 of customer friction (a held payment, a support call, some churn risk). The average fraud in our data is €170.

ThresholdAlerts / dayPrecisionRecallF1Missed fraud €Review + friction €Total € / day
0.5 (default)7093.9%32.8%0.4917,86241418,276
0.212872.5%46.4%0.5713,5221,16514,688
0.12 (lowest cost)18156.7%51.4%0.5412,2082,08214,290
0.0541427.6%57.2%0.379,9996,56616,565
0.021,12011.1%62.4%0.198,33720,53028,866
0.0054,8142.9%70.4%0.065,79194,17699,966
What each alert volume costs per dayDaily cost in euros against the number of alerts per day, for 100,000 transactions a day with 0.2% fraud. Cost = missed fraud + €5 review per alert + €15 friction per false alert. Without a model the bank loses €34,065 a day. Lowest total cost €14,290 a day at 181 alerts (threshold 0.1214). Above about 400 alerts a day the review and friction costs grow faster than missed fraud falls.What each alert volume costs per dayDecodeTheFuture.orgprecision-vs-recall-fraud-detectionChartimage/svg+xml© DecodeTheFuture.orgtotal costmissed fraudreview + friction€ per day0k10k20k30k40k50kminimum €14,290 at 181 alertsno model: €34,06520501002005001,0002,000alerts per day (log scale)
Total daily cost is a U-shape. Below about 180 alerts, each extra alert prevents more fraud than it costs. Above it, review and friction grow faster than losses fall. By 2,000 alerts a day the model costs more than having no model. Source: DTF calculation.

The friction price is the guess people argue about, and it moves the answer a lot:

Friction per false alertBest thresholdAlerts / dayPrecisionRecall
€0 (review only)0.0543126.7%57.5%
€50.0731435.4%55.6%
€150.1218156.7%51.4%
€500.2511079.9%44.0%

So “should we optimise precision or recall?” is really “how much does a false decline cost us?” Settle that number with the business first. scikit-learn (since 1.5) ships TunedThresholdClassifierCV, which tunes the threshold by cross-validation. Its default scorer is balanced accuracy, not your euros, so pass your own cost function. In the library’s cost-sensitive example on the ULB card data, a business metric moved the threshold from 0.5 to about 0.03 and raised the modelled benefit from €244,920 to €249,433.

The threshold picker: alerts per day to threshold

Most teams do not start from costs. They start from headcount. If your review team can work N alerts a day, rank each day’s payments by score and alert on the top N. The cut-off score and its precision then follow:

Team can handleCut-off score (median day)Precision at kRecallTotal € / dayWhat to do
25 alerts0.9098.8%12.4%25,169Capacity is the bottleneck; hire or automate
50 alerts0.6998.0%24.5%20,813Use all of it
100 alerts0.2883.6%41.8%15,624Use all of it
200 alerts0.1152.0%52.0%14,449About right; optimum is ~180
400 alerts0.0528.5%57.1%16,266Don’t fill it; cap near 180 and spend spare hours on investigations
800 alerts0.0315.2%60.6%23,068Over-alerting costs more than it saves

Notice the 200 row: precision and recall are both 52.0%. When alerts per day equal frauds per day, TP + FP equals TP + FN. Spare capacity is the less obvious lesson. A team that can handle 400 alerts and fills the queue spends about €2,000 a day more than one that stops near 180.

PR-AUC or ROC-AUC for imbalanced data?

For an alert queue, report PR-AUC. ROC-AUC measures ranking quality, but it is blind to how rare fraud is. Our model has a ROC-AUC of 0.91, which sounds strong. Its PR-AUC (average precision) is 0.51. That is about 250 times the random baseline of 0.002, and still only a coin flip on precision. To see why, we kept the scores fixed and changed only the fraud share in the evaluation set:

Same model, rarer fraud: ROC-AUC stays, PR-AUC fallsOne fixed model and its scores. Only the share of fraud in the evaluation set changes (fraud rows subsampled or legitimate rows subsampled, mean of 5 draws). fraud share 50%: ROC-AUC 0.9112, PR-AUC 0.9299; fraud share 10%: ROC-AUC 0.9106, PR-AUC 0.7718; fraud share 2%: ROC-AUC 0.9105, PR-AUC 0.6495; fraud share 0.2%: ROC-AUC 0.9106, PR-AUC 0.5128; fraud share 0.05%: ROC-AUC 0.9071, PR-AUC 0.426.Same model, rarer fraud: ROC-AUC stays, PR-AUC fallsDecodeTheFuture.orgprecision-vs-recall-fraud-detectionChartimage/svg+xml© DecodeTheFuture.orgROC-AUCPR-AUC (average precision)fraud share in the data0.000.250.500.751.0050%0.910.9310%0.910.772%0.910.650.2% (ours)0.910.510.05%0.910.43
ROC-AUC stays at 0.91 whether fraud is 50% or 0.05% of payments. PR-AUC drops from 0.93 to 0.43, because the same false positive rate means more false alerts per real fraud when fraud is rarer. Source: DTF calculation, mean of 5 resamples.

Takaya Saito and Marc Rehmsmeier made this case in PLOS ONE in 2015. “The ROC plots are unchanged between balanced and imbalanced datasets,” they wrote, and the PR plot’s baseline moves with the class ratio, y = P / (P + N). Our ROC curve shows what that hides. Reaching 80% recall needs a false positive rate of just 13.7%, which sounds tolerable. In payments that means 13,698 false alerts a day and a precision of 1.15%.

There is a second side. Tom Fawcett’s 2006 introduction to ROC analysis calls that same insensitivity “an attractive property”: it lets you compare models across months, and he notes that fraud proportions vary month to month. In 2024 Matthew McDermott and co-authors went further at NeurIPS. They argued that AUPRC “is not generally superior in cases of class imbalance” and can favour gains in high-prevalence subgroups. Jesse Davis and Mark Goadrich proved back in 2006 that one curve dominates in ROC space if and only if it dominates in PR space. Use ROC-AUC to ask “does the ranking improve?” and PR-AUC or precision at k to ask “what will the queue look like?”. A fraud manager mostly asks the second.

One trap: average precision is not the trapezoidal area under the PR curve. The scikit-learn docs warn that the trapezoid “uses linear interpolation and can be too optimistic”. Ours agree (0.5128 vs 0.5127); small test sets can drift apart.

F1 vs PR-AUC: which number goes in the report?

Both, for different jobs. PR-AUC summarises the whole curve; F1 describes one threshold. F1 at 0.5 was 0.49 for our model and 0.57 at 0.24, with the same model and the same PR-AUC. David Hand and Peter Christen pinpointed a deeper flaw in 2018 (Statistics and Computing). F1 is a weighted mix of precision and recall whose weights depend on the method being evaluated, while “the relative importance assigned to precision and recall should be an aspect of the problem”. In fraud, the problem has a price list, so use it. A report a manager can act on fits on one line: threshold, alerts per day, precision, recall, recall by value, and euros per day against the no-model baseline.

What is precision at k for an alert queue?

Precision at k is the share of fraud among the k highest-scored transactions, with k set to what your team can review. The open fraud detection handbook by Yann-Aël Le Borgne, Gianluca Bontempi and colleagues (ULB and Worldline) explains why: investigators are limited, so “the number of alerts that may be checked during a given period is therefore necessarily limited”. It also defines card precision at k, which counts several flagged payments on one card as one alert, because an investigator checks them together.

Now back to that 64% recall by value. Rank by expected loss, probability × amount, instead of by probability, and something odd happens. At 50 alerts a day precision falls from 98% to 59%, yet the fraud value stopped rises from €13,517 to €17,042. The same idea works as a rule. Elkan’s cost logic says to flag a payment when p × amount > €5 + (1 − p) × €15, which is a threshold of 20 / (amount + 15). That is 0.17 for a €100 payment and 0.02 for a €1,000 one. This amount-aware rule had 26.6% precision and 28.0% recall by count, worse than our “optimal” threshold on both classic metrics. It still caught 68% of fraud value and cost €14,112 a day, the cheapest result in the whole experiment.

It also skips almost all card-testing fraud, the €1–€6 probes. They cost almost nothing in our model. In real life the point of a test charge is to check that a card works before a bigger one. Our cost function does not know that. Yours might.

Precision and recall in Python

This snippet ran against scikit-learn on our simulated data (X_train, y_train, ten test days in X_test, y_test, and payment amounts in euros in amount):

import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import average_precision_score, roc_auc_score, confusion_matrix
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler

model = make_pipeline(StandardScaler(), LogisticRegression(max_iter=1000))
model.fit(X_train, y_train)
p = model.predict_proba(X_test)[:, 1]            # fraud probability

print("ROC-AUC", roc_auc_score(y_test, p))
print("PR-AUC (AP)", average_precision_score(y_test, p))

REVIEW, FRICTION, DAYS = 5.0, 15.0, 10            # EUR per alert, EUR per false alert

def daily_cost(t):
    flag = p >= t
    missed = amount[(~flag) & (y_test == 1)].sum()
    false_alerts = (flag & (y_test == 0)).sum()
    return (missed + REVIEW * flag.sum() + FRICTION * false_alerts) / DAYS

best = min(np.geomspace(1e-3, 0.9, 300), key=daily_cost)
tn, fp, fn, tp = confusion_matrix(y_test, p >= best).ravel()
print(best, daily_cost(best), tp / (tp + fp), tp / (tp + fn))

With scikit-learn 1.9.1 it printed ROC-AUC 0.910, PR-AUC 0.514 and a best threshold of 0.153 at €14,276 a day (precision 0.63, recall 0.50, about 157 alerts a day). The cost curve is flat near its bottom, so 0.12 to 0.15 are practically tied.

How we calculated this

All numbers come from calc.py (numpy, seed 2026, about 30 seconds). It generates 100,000 synthetic payments a day with 0.2% fraud. Features: amount, night flag, distance from the usual location, card velocity, device age, card-not-present flag and merchant risk. Fraud comes in three invented kinds: card testing (27%), account takeover (33%) and “subtle” fraud that resembles the customer (40%). A logistic regression was trained on 6 days and tested on 10 (1,000,000 payments, 2,000 frauds). Trained on the true class mix, its average predicted probability (0.0020) matches the fraud rate. scikit-learn 1.9.1 returned identical ROC-AUC and average precision on the same scores. The €5 review and €15 friction costs are our assumptions, not industry figures; missed fraud counts at full amount. Limits: synthetic data, a simple model, no drift, no delayed labels. Use the method, not our numbers.

The stakes are real, though. The joint EBA-ECB report of 15 December 2025 puts payment fraud in the European Economic Area at €4.2 billion in 2024, with €1.329 billion of it on EU/EEA-issued cards. For governance, see our overview of AI in risk management. Our Isolation Forest guide shows what an unsupervised model’s default threshold does to an alert queue. The hardest cases for recall look like real customers, such as synthetic identity fraud.

FAQ

What is the difference between precision and recall?

Precision is the share of flagged cases that are truly positive, TP / (TP + FP). Recall is the share of all true positives that were flagged, TP / (TP + FN). In fraud, precision is the queue’s hit rate; recall shows how much fraud you catch.

Why is accuracy misleading for fraud detection?

With 0.2% fraud, a model that approves everything is 99.8% accurate and catches nothing. Accuracy treats every error as equal, so it can prefer a threshold that loses more money.

Is a higher precision or a higher recall better for a bank?

It depends on the cost of each error. If false alerts are cheap and missed fraud is expensive, favour recall. If blocked customers are costly, favour precision. In our simulation the cost-optimal setting was 57% precision and 51% recall.

What is a good PR-AUC for fraud detection?

There is no universal cut-off, because PR-AUC depends on the fraud rate. Compare it with the random baseline, which equals the fraud share. Our model’s 0.51 at 0.2% fraud is about 250 times that baseline.

Should I report ROC-AUC or PR-AUC to management?

For alert-queue decisions, report PR-AUC plus precision, recall, alerts per day and euros saved at the chosen threshold. ROC-AUC still helps check whether a new model ranks better, because it is stable when the fraud rate shifts.

How do you calculate precision at k?

Sort the period’s transactions by model score, take the top k (your review capacity), and divide the number of confirmed frauds among them by k. With k = 100 and 84 frauds in the top 100, precision at 100 is 84%.

What threshold should a fraud model use instead of 0.5?

The one that minimises total cost: missed fraud plus review cost plus customer friction. In our simulation it was 0.12, cutting daily cost from €18,276 to €14,290.

Before the next model review, ask the business one question: what does a false decline cost us? Then rerun the table above with that number.

Sources

  1. Saito, T. and Rehmsmeier, M. (2015). The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets. PLOS ONE 10(3), e0118432.
  2. Davis, J. and Goadrich, M. (2006). The Relationship Between Precision-Recall and ROC Curves. Proceedings of the 23rd International Conference on Machine Learning (ICML), pp. 233–240.
  3. Davis and Goadrich (2006), abstract page, University of Wisconsin–Madison.
  4. Fawcett, T. (2006). An Introduction to ROC Analysis. Pattern Recognition Letters 27(8), 861–874.
  5. McDermott, M. B. A., Zhang, H., Hansen, L. H., Angelotti, G. and Gallifant, J. et al. (2024). A Closer Look at AUROC and AUPRC under Class Imbalance. NeurIPS 2024, arXiv:2401.06091.
  6. Hand, D. and Christen, P. (2018). A Note on Using the F-measure for Evaluating Record Linkage Algorithms. Statistics and Computing 28(3), 539–547.
  7. Hand and Christen, accepted manuscript and abstract, Spiral repository, Imperial College London.
  8. Elkan, C. (2001). The Foundations of Cost-Sensitive Learning. Proceedings of IJCAI 2001, author copy, UC San Diego (PDF).
  9. scikit-learn 1.9.1 user guide: Tuning the decision threshold for class prediction.
  10. scikit-learn 1.9.1 API: TunedThresholdClassifierCV (added in version 1.5).
  11. scikit-learn 1.9.1 example: Post-tuning the decision threshold for cost-sensitive learning (credit card fraud section).
  12. scikit-learn 1.9.1 API: average_precision_score.
  13. scikit-learn 1.9.1 API: precision_recall_curve.
  14. scikit-learn 1.9.1 API: fbeta_score.
  15. Le Borgne, Y.-A., Siblini, W., Lebichot, B. and Bontempi, G. Reproducible Machine Learning for Credit Card Fraud Detection: Practical Handbook (ULB Machine Learning Group and Worldline). Precision top-k metrics.
  16. OpenML dataset 1597: creditcard (Dal Pozzolo, Caelen, Bontempi; ULB Machine Learning Group), European cardholders, September 2013.
  17. Dal Pozzolo, A., Caelen, O., Johnson, R. A. and Bontempi, G. (2015). Calibrating Probability with Undersampling for Unbalanced Classification. IEEE SSCI, pp. 159–166.
  18. European Banking Authority (15 December 2025). Joint EBA-ECB report on payment fraud: strong authentication remains effective but fraudsters are adapting.
  19. Sparck Jones, K. (ed.) (1981). Information Retrieval Experiment, chapter 13: The Cranfield tests, pp. 264–265. Butterworths; NIST IR library text.
  20. Cleverdon, C., Mills, J. and Keen, M. (1966). Factors Determining the Performance of Indexing Systems, vol. 1 (Aslib Cranfield Research Project), p. 13; NIST IR library text.

Papers, documentation and reports checked on 6 December 2026; DOIs resolved at api.crossref.org. Simulation results are DTF calculations on synthetic data (calc.py and calc.json, seed 2026), cross-checked with scikit-learn.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments