[scikit-learn] LogisticRegression coef_ greater than n_features?

pisymbol pisymbol at gmail.com
Mon Jan 7 23:50:49 EST 2019

According to the doc (0.20.2) the coef_ variables are suppose to be shape
(1, n_features) for binary classification. Well I created a Pipeline and
performed a GridSearchCV to create a LogisticRegresion model that does
fairly well. However, when I want to rank feature importance I noticed that
my coefs_ for my best_estimator_ has 24 entries while my training data has

What am I missing? How could coef_ > n_features?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20190107/8a4ec8f1/attachment.html>

More information about the scikit-learn mailing list