Contents
06Interview follow-ups
6.1Do you even need to rebalance?
Often not. The last row of Table 1 is the plain model, trained on the raw data, with the threshold lowered to 4\%: it already reaches 74\% recall with 296 false positives. Its probabilities are already in the real proportions, by (2), so Proposition 3 applies to it directly. Figure 5a shows recall against false positives at every threshold for the plain model and the corrected weighted model: the two curves are close, and each remedy is mostly a different point on a similar curve. Since rebalancing is equivalent to moving the threshold (Elkan, 2001), the first thing to try is the threshold. Rebalancing or weighting earns its place when it changes the model itself for the better, for example a flexible learner that otherwise never splits on the rare class, or a model that needs many more examples of the rare class to learn its shape.
6.2Resample before or after the split?
After, and only inside the training data. Suppose we run SMOTE on all of day 1 and then cross-validate (Episode 11). A synthetic fraud is built from a fraud and its neighbor; when that fraud or its neighbor falls in the validation fold, the model has been trained on a near copy of a validation point. The cross-validated average precision comes out at 0.99. Done right, with SMOTE applied only to the training folds and the validation fold left untouched, it is 0.69, and the test day gives 0.71, which confirms the second number (Figure 5b). The rule covers every step that looks at the data: undersampling, oversampling, SMOTE, scaling, feature selection. Put them in a pipeline that is fitted inside each training fold, and keep the validation and test data in their real proportions.
6.3Which metric do you report?
Not accuracy: never flagging anything already scores 99.85\% on our test day. Report the precision–recall curve and its average precision, which focus on the rare class (Episode 12), or better, the real cost at the chosen threshold: here C_{\mathrm{FP}}\cdot\mathrm{FP}+C_{\mathrm{FN}}\cdot\mathrm{FN}. And if the probabilities themselves are used, check their calibration (log loss, Episode 8) on data in the real proportions, after the correction.
Pause and think. A teammate’s notebook applies SMOTE, then splits into training and test sets, and reports average precision 0.99. What is wrong, and what do you expect on new data?
Show the answer
The test set contains synthetic frauds interpolated from training frauds: near copies of training points. Expect much less on real new data; in our case about 0.7.