In handwritten digit recognition problem using logistic regression, what changes needed to add another class "Not a Digit"
Logistic regression is normally used to perform binary classification, which answers a yes or no question, e.g.:


Is this an 8 or not?
Will it rain today or not?


Perhaps I have misunderstood your explanation, but it sounds like you are trying to perform multi-class classification, i.e. to classify an image as one of a certain number of options. So a single image must contain (be classified as) a number from the list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].

Usually, to add an extra class to a model that already does this, you would need to adjust the final output of the model to predict a one-hot vector that is simply one element longer!

In the specific case of the Scikit-Learn LogosticRegression class, it seems as though you don't need to specify anything - the class will automatically use a multinomial model and relevant optimiser as soon as it sees that data is not binary (i.e. a yes-no model as explained above).

Have a look at this official tutorial, which should a multinomial model trained on a dataset with a target variable that has a total of 20 classes. The number of features (n_classes is equal to 20) is not passed to the model at all, it is inferred.