J. Bernardi

Project · Tabular · 2024 · team of four

Fraud detection in consumer-credit baskets

Gradient boosting on 116k purchase baskets with 1.4% fraud. First place on both leaderboards of the BNP Paribas challenge.

A forest of shallow trees, each correcting the last; the one leaf that flags the rare fraudulent basket is inked in red.

Problem

BNP Paribas Personal Finance wants to flag fraudulent baskets before a credit is approved (ENS Challenge Data no. 104). Each basket holds up to 24 items described across 147 columns, and only 1.42% of the 92,790 training baskets are fraudulent, so the metric is precision–recall AUC.

Method

We flattened the item slots into basket-level aggregates (item count, total price, category indicators), one-hot encoded categories and kept the fraud rate identical across an 80/20 split. A decision tree, logistic regression, a random forest and gradient boosting were compared; the boosted model was tuned with a randomised hyperparameter search (RandomizedSearchCV) under cross-validation.

Results

Gradient boosting placed first on both leaderboards. The most informative features were basket size and total price, a few high-risk categories, and brand × model interactions such as repeated high-end phones.

Measurements

SettingValueNote
Decision tree0.07
Logistic regression0.01
Random forest0.22
Gradient boosting (public leaderboard)0.28131st place
Gradient boosting (private leaderboard)0.35071st place

PR-AUC for each model. The two boosted scores are the official leaderboard results.

Stack

Python · scikit-learn · pandas · NumPy · Jupyter

Small print

Keyboard & errata

g i
Go to the index
g w
Go to work
g p
Go to the field log
g a
Go to about
g o
Go to now
t
Paper / darkroom
[ ]
Previous / next project
?
This sheet
  1. Index For “models taken apart”, read “models that took me apart, a little, each time”.
  2. GANs Some rejected digits were, on reflection, perfectly good digits.
  3. Work The list shows every project but one. See the missing one →