For the write-up's where it fails section, list each test sample the model got wrong, and the one measurement that pushed it hardest towards its wrong answer.
The model is a scaled logistic regression on the breast cancer data. Class 1 is benign, class 0 is malignant. A positive push moves a row towards benign, a negative push towards malignant.
Task: write mistakes(test_size).
load_breast_cancer(return_X_y=True, as_frame=True) and split with train_test_split(X, y, test_size=test_size, random_state=0, stratify=y).make_pipeline(StandardScaler(), LogisticRegression(max_iter=1000)) on the training rows.coef_[0].1, the culprit is the column with the largest push. If it predicted 0, the culprit is the column with the most negative push.[position_in_test_set, true_class, predicted_class, culprit] for every wrong row, in test-set order. Positions start at 0, and both classes are plain ints.