Why RidgeClassifier can be significantly faster than LogisticRegression with a high number of classes? In Scikit document, we can find this statement

The RidgeClassifier can be significantly faster than e.g. LogisticRegression with a high number of classes because it can compute the projection matrix $(1/(X^TX))X^T$ only once.

Whys is this so? Can it be explained intuitively ?


The Ridge regressor has a classifier variant: RidgeClassifier. This classifier first converts binary targets to {-1, 1} and then treats the problem as a regression task, optimizing the same objective as above.

https://scikit-learn.org/stable/modules/linear_model.html#classification
So it's a linear model that has closed-form solution. Logistic regression is linear in parameters, but this is followed by logistic transformation, so we need an optimization algorithm to fit it. So it is faster for the same reason linear regression is faster than logistic regression.
