A bank has a list of transactions. Almost all are "ok", and only a few are "fraud". A plain random split can leave the test set with almost no fraud at all.
Task: write rare_in_test(labels, rare_label, test_size, seed).
labels is a list of labels, one per transaction. rare_label is the label you care about.labels with train_test_split(labels, test_size=test_size, random_state=seed).stratify=labels.[plain, stratified]: how many times rare_label appears in the test part of each split.