Fraud is 0.4% of transactions in a payments dataset. A student runs train_test_split(X, y, test_size=0.2, random_state=42) and gets a test set with almost no fraud cases, so precision and recall swing wildly between runs.
Which single change most directly fixes the problem?
Why did you pick that answer? Two or three sentences. The act of articulating it is what builds the judgment — not the click that follows.
Stratified splitting preserves the class proportions in train and test, so the rare class is represented as evenly as the data allows and metrics stop swinging with the luck of the draw. It is one keyword, and it is the single most important line in a classification notebook.
Removing the seed only makes results irreproducible. The rare class can still be nearly absent in any given draw.
Doubling the test set doubles the expected fraud cases but also halves training data, and the split can still be lopsided without stratification.
Discarding 99% of legitimate transactions destroys the base rate your test metrics must reflect. If you rebalance at all, do it on the training set only.