The accuracy depends on the hyper-parameter in a strongly non-monotinic way
I have a data set labelled with a binary classes. I calculated the principal components from the data, then made the PC transformation. The goal is to find an optimal number of PCs so that the binary classification accuracy is good enough.
I've learned a binary classifier sklearn.linear_model.LogisticRegressionCV
(default parameters) on the PC-transformed data. The number of PCs was the (hyper-)parameter and it was varied.
I cannot interpret the resulting Accuracy v. #PCs graph, why is it so strange? For number of PCs 50, there is a 'floor' in accuracy~0.8 against which a sharp peaks stick out up to 0.9-1.0. Positions of the peaks is slightly changed when re-run the classifier so it's not the data things, it's just the classifier feature, plus the random train-test split.
How to find the optimal number of PCs given the required accuracy level?
PS: The same behavior is observed on the multi-class data and the same pipeline used.
Topic hyperparameter logistic-regression classification
Category Data Science