eli5 icon indicating copy to clipboard operation
eli5 copied to clipboard

show_weights() shows weights for only one class

Open rvoak opened this issue 6 years ago • 2 comments

I have trained a Logistic Regression classifier (from sklearn) for a binary classifier. However, when I use eli5 to examine my weights, I see the top coefs for only one class (y=1).

Here is my code:

from sklearn.linear_model import LogisticRegression
lr_0 = LogisticRegression(random_state = 42)
lr_0.fit(xtrain_tfidf_ngram,Ytr)

import eli5
eli5.show_weights(lr_0, vec=tfidf_vect_ngram, top=10,target_names=lr_0.classes_,) 

Can anyone help me? Why am I seeing only one class?

rvoak avatar Nov 11 '19 20:11 rvoak

Same here. Did you find any solution? @rvoak

lefterisloukas avatar May 15 '20 11:05 lefterisloukas

I guess this might be the normal usage, according to https://stackoverflow.com/questions/51659523/eli5-show-weights-with-two-labels.

lefterisloukas avatar May 20 '20 08:05 lefterisloukas