skorecard icon indicating copy to clipboard operation
skorecard copied to clipboard

Add feature importance method to Skorecard class

Open orchardbirds opened this issue 3 years ago • 10 comments

The feature importance in the context of the skorecard model is the feature IV*coef of the logistic regression.

Let's make this calculation within the skorercard class In terms of code, it's similar to this

X_train_bins = scorecard.bucket_transform(X_train)
iv_dict = iv(X_train_bins, y_train)

iv_values = pd.Series(iv_dict).sort_values(ascending=False)
iv_values.name="IV"

feat_importance = model_stats[['Coef.']].join(iv_values)
feat_importance['importance'] = -1.*feat_importance['Coef.']*feat_importance['IV']
feat_importance.sort_values(by='importance', ascending=False)

orchardbirds avatar Jun 10 '21 10:06 orchardbirds

We also then need to update docs/tutorials/3_skorecard_models.ipynb, this section:

image

timvink avatar Aug 16 '21 15:08 timvink

Also a suggestion, the coefficients have their own intervals(usually 5% and 95%), it would be great to have a weight plot. I would like to contribute in this issue.

satya-pattnaik avatar Sep 03 '21 20:09 satya-pattnaik

@satya-pattnaik This sounds like a really nice idea. If you like, I can open a separate issue for this and assign you to it?

orchardbirds avatar Sep 20 '21 08:09 orchardbirds

Sounds good, you can assign it to me @orchardbirds .

satya-pattnaik avatar Sep 20 '21 09:09 satya-pattnaik

Hey @orchardbirds @satya-pattnaik do you still plan to work on this issue ? Let me know how we can help you.

anilkumarpanda avatar Dec 08 '22 13:12 anilkumarpanda

Hi is this issue still open, i would like to work on it

rishabsinghh avatar Jun 13 '23 09:06 rishabsinghh

@rishabsinghh awesome, I believe so. What do you think @anilkumarpanda ?

ReinierKoops avatar Jun 13 '23 15:06 ReinierKoops

Whats the update? can i ?

rishabsinghh avatar Jun 14 '23 12:06 rishabsinghh

Yes

ReinierKoops avatar Jun 14 '23 12:06 ReinierKoops

Hi @rishabsinghh thanks for picking this up.

anilkumarpanda avatar Jun 14 '23 18:06 anilkumarpanda