skorecard
skorecard copied to clipboard
Add feature importance method to Skorecard class
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)
We also then need to update docs/tutorials/3_skorecard_models.ipynb
, this section:
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 This sounds like a really nice idea. If you like, I can open a separate issue for this and assign you to it?
Sounds good, you can assign it to me @orchardbirds .
Hey @orchardbirds @satya-pattnaik do you still plan to work on this issue ? Let me know how we can help you.
Hi is this issue still open, i would like to work on it
@rishabsinghh awesome, I believe so. What do you think @anilkumarpanda ?
Whats the update? can i ?
Yes
Hi @rishabsinghh thanks for picking this up.