<div dir="ltr"><div>Also Sebastian, I have binary classes but they are strings:</div><div><br></div><div>clf.classes_:<br></div><div><pre>array(['American', 'Southwest'], dtype=object)<br><br><br></pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 8, 2019 at 9:51 AM pisymbol <<a href="mailto:pisymbol@gmail.com">pisymbol@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>If that is the case, what order are the coefficients in then?</div><div><br></div><div>-aps<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 8, 2019 at 12:48 AM Sebastian Raschka <<a href="mailto:mail@sebastianraschka.com" target="_blank">mail@sebastianraschka.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">E.g, if you have a feature with values 'a' , 'b', 'c', then applying the one hot encoder will transform this into 3 features.<br>
<br>
Best,<br>
Sebastian<br>
<br>
> On Jan 7, 2019, at 11:02 PM, pisymbol <<a href="mailto:pisymbol@gmail.com" target="_blank">pisymbol@gmail.com</a>> wrote:<br>
> <br>
> <br>
> <br>
> On Mon, Jan 7, 2019 at 11:50 PM pisymbol <<a href="mailto:pisymbol@gmail.com" target="_blank">pisymbol@gmail.com</a>> wrote:<br>
> 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 22.<br>
> <br>
> What am I missing? How could coef_ > n_features?<br>
> <br>
> <br>
> Just a follow-up, I am using a OneHotEncoder to encode two categoricals as part of my pipeline (I am also using an imputer/standard scaler too but I don't see how that could add features).<br>
> <br>
> Could my pipeline actually add two more features during fitting?<br>
> <br>
> -aps<br>
> _______________________________________________<br>
> scikit-learn mailing list<br>
> <a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
<br>
_______________________________________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scikit-learn</a><br>
</blockquote></div>
</blockquote></div>