guillermo-navas-palencia / optbinning

Optimal binning: monotonic binning with constraints. Support batch & stream optimal binning. Scorecard modelling and counterfactual explanations.
http://gnpalencia.org/optbinning/
Apache License 2.0
435 stars 98 forks source link

Manual binning / Reverse Scorecard #243

Closed sanketshrishrimal closed 1 year ago

sanketshrishrimal commented 1 year ago

I need help on below two points,

1)How do you combine bins manually, I understand that if I reduce the number of n_bins it will combine top bins but lets say I have 10 bins and I want to combine bin number 6, 7 together, is there a way I can do that?

2) The points that I get from scorecard.table(style="detailed") they are showing upside down meaning higher the event rate lower the points and lower the event rate higher the points which is not correct it should be higher the event rate higher the score and vice versa. I understand that there is a parameter "scorecard_Reverse=True" which solves the problem but I want to know how is it doing that, If I can get the formula or something which will help me understand that will be great.

guillermo-navas-palencia commented 1 year ago

Hi, @sanketshrishrimal.

  1. To combine bins manually please use the parameters user_splitsand user_splits_fixed.
  2. The points are calculated using the WoE values (the standard method). You can find the formulas within the scorecard.py code.
vunh16 commented 1 year ago

Hi @guillermo-navas-palencia,

First of all, love your work, you’re my savior publishing this package. Can you please give examples how one use user_splits parameter? Especially when my dtype is categorical?

Thank you so much.

guillermo-navas-palencia commented 1 year ago

Hi @vunh16. You can follow this tutorial: http://gnpalencia.org/optbinning/tutorials/tutorial_binary.html. It starts at cell 54.