← All posts

Card Fraud on Kaggle: Picking Models by Honest CV

In November 2026 I entered Playground Series S6E11 on Kaggle: predict whether a card transaction is fraudulent, scored by ROC-AUC. I finished 358th of 3,769 teams with a private AUC of 0.94927. Both final files were chosen by nested five-fold cross-validation (CV), never by the public leaderboard, and the write-up is called "Picking by honest CV" for that reason.

This post covers what the data turned out to be, the model, the validation rules, what the private board said, what did not help, and how my own tabular foundation model, FinTFM, fared on a task it was not built for. It ends with a short look back at Home Credit, a credit-risk competition from 2024 where I won a bronze medal. The numbers come from the code repository, its decision log and its findings document.

In short

  • The synthetic data reuses values from a 20,000-row original, so exact values, digits and value counts carry fraud signal. In-fold encodings, a logistic regression and shallow trees started from its logit gave the best single model, CV 0.95098.
  • Stacks of own and fold-checked public models reached CV 0.95273. Every file lost 0.003 to 0.0045 from public to private, and the final pick scored 0.94927, rank 358 of 3,769.
  • A simulation on labelled rows showed that blends fitted to a 60,000-row "public" sample lost on the remaining rows in all 20 splits and at every strength. That supports picking by CV.
  • FinTFM, my credit-risk foundation model, was a reasonable single model but added nothing to the stack. Members that differ helped; more of the same did not.

The task and the data

Kaggle's Playground Series runs monthly tabular competitions on synthetic data. Episode 11 of season 6 had 699,960 training rows with a fraud rate of 1.67 per cent and 299,984 test rows. Each row has 24 features: six continuous columns such as amount_usd, velocity_score and merchant_risk_score, seven integer columns, five categorical columns and six flags such as used_vpn. The metric is ROC-AUC, so only the ranking of the predictions matters.

The rows were generated from a public 20,000-row dataset, Credit Card Fraud Detection 2026 (CC0). Measuring how the two relate shaped everything that followed.

  • No training or test row equals an original row on all 24 columns, but 85 to 100 per cent of each continuous column's values also occur in the original.
  • velocity_score and merchant_risk_score values that occur 20 to 100 times in train and test together have a fraud rate of 10.3 per cent, against 1.67 per cent overall.
  • 105,697 rows repeat the (velocity_score, merchant_risk_score) pair of one original row, and their fraud rate is 0.81 per cent.
  • amount_usd values absent from the original have a fraud rate of 2.42 per cent, against 1.65 per cent for the rest.

So the generator reuses the original's values and recombines them into new rows. A row's exact value, its digits, how often it occurs and whether it copies a pair from one original row all say something about the label. A plain tree on the raw numbers cannot read most of that.

The model

Pipeline: in-fold keys, a logistic regression, shallow trees from its logit, a logistic stack, a mean of four stacks and zero-fraud zones Keys, encoded in fold exact values, digits, counts Logistic regression L2, splines, logit encodings Shallow boosted trees started from its logit Logistic stack own and checked public members Mean of four stacks equal weights on logit-ranks Zero-fraud zones edges refitted in each fold Top row: single models. Bottom row (highlighted): combining them. Every fitted step sees only training folds.
Figure 1. The final pipeline. The single models (top row) are the repository's own; the stacks (bottom row) also use public out-of-fold predictions that passed a fold check.
  1. Keys, encoded inside each fold. Every column's exact value as a category, plus digit keys (integer part, first significant digits, printed length, cents), token keys, a few joint keys such as merchant category by risk score, and the count of every key. Target encodings (a smoothed fraud rate per key) are cross-fitted inside the training fold, at three smoothing weights side by side.
  2. A logistic regression first (a generalised linear model, GLM). L2 regularised, on the encodings, one-hot columns and cubic splines.
  3. Shallow trees started from its logit. LightGBM with four leaves, XGBoost at depth 2 and CatBoost at depth 4 each start from the regression's prediction instead of from a constant, so they only learn what it missed. These were the strongest single models.
  4. A logistic stack over the members' out-of-fold logits.
Bar chart of single-model CV AUC rising from 0.94690 to 0.95096 over five steps Best single model, step by step (5-fold CV AUC; axis starts at 0.946) 31-leaf LightGBM, raw columns 0.94690 + in-fold encoding of exact values, keys 0.94854 4-leaf trees and pair keys 0.94923 Trees started from the regression logit 0.95056 All keys, three smoothings, joint keys 0.95096
Figure 2. Single-model CV, step by step. The two largest steps are encoding exact values inside each fold (+0.00164) and starting the trees from the regression's logit (+0.00133, highlighted).

Shallow trees won consistently. Four leaves beat 31 by 0.0006 to 0.0008 on all five folds, and eight leaves were already slightly worse. A residual booster started from the final stack's logit stopped after 1 to 7 rounds. My reading is that the label is mostly a sum of per-column effects with a few interactions, which a regression plus small trees fits well. That reading was never tested against a purpose-built additive model.

Validation rules

  • One fold split for everything. Five stratified folds with a fixed seed, so every model's out-of-fold predictions can be stacked without leakage. Stack scores are nested: the stacker is fitted on four folds of member predictions and scored on the fifth.
  • Adopt a change only if the pooled CV rises and at least four of the five folds rise with it. Most ideas failed this rule.
  • Early stopping away from the scored fold. Until round 10 of the decision log, the boosters stopped on the same fold they were then scored on. Choosing the round count on a 10 per cent holdout of the training fold instead lowered single-model CVs by 0.00004 to 0.00009. Small, but it was an optimistic bias.
  • Check public predictions before stacking them. Many entrants publish out-of-fold predictions on the shared split. A member was accepted only if its row counts were right, its fold file matched ours row by row (or the source stated the same split), and the AUC computed here matched the author's within 0.0001. Reading each source's notes left out several more, for example members that had stopped early on the validation fold, which makes their out-of-fold scores optimistic.
  • Check for a train/test shift. A LightGBM asked to tell training rows from test rows scored AUC 0.50013: no shift. That is what lets CV stand in for the private board.

Stacks and the final picks

Own models alone stopped near CV 0.9514. Adding checked public members (GPT-2 language models trained on the rows as text, RealMLP and TabM networks, TabPFN, regressions and boosters) took a stack of 173 members to 0.95225. After that, three small steps passed the four-of-five rule:

  • Zero-fraud zones. Public notebooks found four regions of the training rows with no fraud at all, for example merchant_risk_score below 13.1. The zones were found on all training rows, so their edges were refitted on four folds and applied to the fifth. Sending zone rows to the bottom added 0.00005 on all five folds.
  • A fit-free average of two stacks with equal weights, on ranks mapped to a logit scale, then zones: CV 0.95263. One was own models plus a public wide stack (a published nested stack of about 200 public members), the other that wide stack alone.
  • A mean of four nested stacks, one built here (which itself contains the public wide stack) and three published by other entrants, with equal weights, then zones: CV 0.95273, up on all five folds. The four agree at rank correlation 0.996 to 0.998 out of fold but 0.991 to 0.999 on test, so averaging them probably cuts variance that any one of them carries.
FileCV (nested)PublicPrivate
Mean of four stacks + zones (final pick)0.952730.953250.94927
Average with one wide stack + zones (final pick)0.952630.952930.94847
Own 21 + 152 public members, no zones (not picked)0.952250.952190.94931
Own models only + zones0.951430.951640.94835
Best single model (3 seeds)0.95098not submittednot submitted

The final pick leans on other entrants' published work: three of its four stacks were built by them. The own-models-only stack, with no public files at all, scored 0.94835 private, 0.0009 below the final pick. That is roughly what the public members were worth.

What the private board said

Scatter plot of nested CV AUC against private AUC for 16 scored stacks; the two final picks are highlighted, the best private file is 0.94931
Figure 3. Nested CV against private AUC for the scored stacks. The final picks are orange. Select any chart to open it at full size.
  • Every file lost from public to private: 0.0030 to 0.0034 for own-model stacks, and 0.0029 to 0.0045 for stacks with public members, the most for those built on the public wide stack. The final pick lost 0.0040. A shift shared by every file leaves the order mostly intact.
  • CV and the public board ranked the 16 stacks equally well, rank correlation 0.83 with private for each. Picking by CV lost nothing against picking by public score here, but it did not win either.
  • One component did not carry over. Against the 173-member stack, the public wide stack added 0.00024 CV and 0.00065 public but cost 0.00071 private. CV cannot see how a member's test predictions were made, so the cause is either there or in noise; the scores alone do not say. Diluting it with two other stacks recovered most of the gap: the final pick scored 0.00080 above the other pick.
  • What I would change: let one of the two picks leave out the single largest public component. The best private file, 0.94931, was such a file, 0.00004 above the pick.

The public board, simulated

The public top was 0.957 and above, far over any CV-backed result. On these folds every CV-backed result met near 0.9526, a level one entrant's notebook called "The 0.9526 Wall". From the public notebooks I read, the top files were blends of scored submissions with weights fitted to their public scores, then pushed further in the same direction, with no out-of-fold check.

That can be tested without the board. On the labelled training rows, 60,000 random rows played the public part, the other 639,960 the private part, and 271 out-of-fold members the scored files. A logistic blend of the files was fitted on the "public" rows at four regularisation strengths. At three of them it gained 0.0004 to 0.0036 on those rows; at all four it lost on the "private" rows (0.0005 to 0.0020 for the three that gained), in all 20 random splits. Pushing the blend further, as the late public notebooks did, roughly doubled the private loss. Fitting on the public rows' labels is more than a real board reveals, so these sizes are an upper bound; the sign is the finding. Even for one honest file, the gap between its "public" and "private" AUC varied with a standard deviation of 0.0029 across splits, wider than the spread of the public top.

What did not help

Each of these was tested and not adopted, except pseudo-labelling, which was not run.

  • More of the same. Seed bags of trees and networks, deeper or slower boosters, other regularisation strengths.
  • An own GPT-2 language model trained on rented GPUs for about USD 9: CV 0.94717 after three epochs, and the stack fell slightly. Two strong public GPT-2 members (0.95003 and 0.95020 alone) also lowered it. A strong new member of a family already in the pool adds nothing.
  • Ideas from older fraud competitions. Undersampling bags, per-value aggregates in the style of IEEE-CIS (the generator recombines values, so a value has no "client" behind it), and Isolation Forest or PCA anomaly scores. Isolation Forest reached AUC 0.811 with no labels at all, which is useful where labels are scarce, but added nothing next to 11,689 labelled frauds.
  • Wider zero-fraud zones. Public notebooks widened the zones to 14 rectangles, each with no fraud among all training rows. With the published edges they pass on all five folds, but only because zero held-out frauds is built in, so they were not adopted. Searching the same edges on four folds let 6 and 11 held-out frauds into the zones. An empty cell found by searching is empty partly by chance.
  • Pseudo-labelling was not run: with no train/test shift, pseudo-labels carry nothing the model that made them does not already know.
Left: a clustered rank-correlation heat map of 256 members. Right: a two-dimensional map of the members coloured by model family, most overlapping in one cloud
Figure 4. The 256 members with out-of-fold AUC of at least 0.945 have a median rank correlation of 0.976 and fall into 66 groups at correlation 0.99. Trees, regressions, networks and language models overlap in one cloud.
Left: fraud rate by score percentile of the final stack on a log scale. Right: share of frauds and share of remaining AUC loss by score band, with most loss in the 50 to 95 percentile bands
Figure 5. Where the remaining AUC is lost. 75 per cent of it comes from the quarter of frauds scored between the 50th and 95th percentile, and under 1 per cent from the 41 per cent already in the top 1 per cent. A new member helps only if it lifts those middle frauds.

FinTFM on a task it was not built for

FinTFM is my tabular foundation model for credit risk, pretrained only on synthetic data. Fraud is a different task, so this was a test of how far it transfers, not an attempt to win with it.

FinTFM settingValidationPublic
Zero-shot, published checkpoint, 2,000 context rows0.8759 (20% holdout)0.88790
In-context, partitioned and balanced contextnot recorded0.91516
Linear readout fitted on the training rows0.9296 (20,000-row holdout)0.94105
For scale: default LightGBM, 500 rounds0.9427 (20% holdout)0.94578
Readout as a stack member0.94054 (5-fold CV alone); not adopted 

The validation figures come from different holdouts and are not comparable across rows; the public column is one board for all. Fitting a linear readout on the model's representations helped most, and the readout came within about 0.005 of a default LightGBM on the public board. In the stack it took a small negative weight, so the stack found nothing in it that the trees and regressions did not already carry. The FinTFM starter notebook is public as a starting point, not a competitive entry.

Looking back at Home Credit

An earlier credit-risk competition of mine was Home Credit: Credit Risk Model Stability in 2024, where I finished 215th of 3,856 teams, a bronze medal. Its metric was unusual: a Gini score computed for each week of loan decisions, with penalties for a falling trend and for week-to-week variability. The host's description puts it plainly: "The scorecard's stability in the future is critical, as a sudden drop in performance means that loans will be issued to worse clients on average."

My notebook built on public work: CatBoost and two LightGBM variants trained on folds grouped by week, averaged in a voting model, plus a post-processing step: a classifier trained to tell training rows from test rows, and a lower score for every test row it was not at least 99.6 per cent sure came from the test set. The boosters also stopped early on the fold they were scored on, the bias the S6E11 entry later removed. It scored about 0.65 on the public board and 0.52 on the private one.

The scores of the two competitions are not comparable, but they share a theme. In Home Credit, each of my three submissions scored about 0.14 lower on the private board than on the public one, under a metric built around change over time. In S6E11, the public board was too small to resolve the differences that mattered. Both reward knowing what a validation number can and cannot tell you, and in S6E11 every choice can be traced to a cross-validated number in the decision log.

Lessons I would keep

  1. Measure how the data was made. Comparing the training rows with the original found the signal that mattered most: reused values, digits and counts.
  2. Make validation honest even when it costs. Early stopping on the scored fold inflated single-model scores by up to 0.00009. Fixing it lowered them slightly and barely moved the stacks, so the earlier conclusions held.
  3. Fix the adoption rule and obey it. Requiring four of five folds rejected most ideas, and kept small pooled gains from being mistaken for progress.
  4. Check imported predictions like code. Fold files, row counts, reported scores and each source's own notes screened out members whose out-of-fold scores were optimistic.
  5. Members that differ help; more of the same does not. Seed bags and wider stacks of similar models did nothing once the members' median rank correlation reached 0.976.
  6. Simulate the board before trusting it. A cheap simulation on labelled rows showed that fitting to the public sample loses on the rest, every time.
  7. Keep one pick independent of the biggest outside component. In hindsight, and on one sample, the file that left out the public wide stack scored best on private, if only by 0.00004 over the pick.

Limits of this post

  • All results are for one synthetic dataset and ROC-AUC. Section 7.5 of the findings separates what is likely to transfer to real fraud work from what is specific to this generator; none of it was run on real transactions.
  • Every model and stack was scored on the same five folds, so some selection optimism remains; the decision log puts it at the order of 0.00002.
  • The public members' training details are not all known, only their folds and reported scores.
  • The Home Credit section describes my notebook from its code. The effect of each step, including the post-processing, on the private score was not measured.

Code, write-up and how to cite

The repository holds the code under the MIT licence, the 38-round decision log, the findings document and the figures. Out-of-fold and test predictions of six own models are on Hugging Face. The honest-CV notebook reproduces an own-models-only stack (public 0.95155, private 0.94819). Most single models ran on private Kaggle CPU kernels and the stacking on a local Mac; the own GPT-2 member ran on rented GPUs. The Kaggle write-up has DOI 10.34740/kaggle/w/129649. Public out-of-fold files and ideas from many entrants made the stacks possible; the repository credits each source and its licence.

Sources