MNIST dataset with Sklearn
Your classifier needs to learn to discriminate between sets of different classes.
If you only care about digit 4, you should split your training and testing set into:

Class 4 instances
Not class 4 instances: union of all other digits

Otherwise the train/test split is still the typical one, where you want to have no overlap.
I’m training linear model on MNIST dataset, but I wanted to train only on one digit that is 4. How do I choose my X_test,X_train, y_test, y_train?