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

scorecard coefficients #233

Closed jmiele6 closed 1 year ago

jmiele6 commented 1 year ago

Thank you for this library it really helps a lot!

I have to questions concerning scorecard:

  1. Is it possible to add intercept to the scorecard?
  2. The coefficients that I get from the scorecard are not the same as I would get from a logistic regression on binned variables (although they are close to them). Why is it so?
guillermo-navas-palencia commented 1 year ago

Hi @jmiele6,

  1. Yes, it is possible. See: http://gnpalencia.org/optbinning/scorecard.html parameter intercept_based.
  2. Could you provide an example? make sure the scaling_method is set to None
jmiele6 commented 1 year ago

Hi, I noticed that the source of my problem was manual adjustment of bins, which was not propagated to scorecard, issue described in: https://github.com/guillermo-navas-palencia/optbinning/issues/151. After using binning_fit_params I got bins, on which coefficients of the scorecard were the same as from regression on binned variables. Therefore the intecept which I needed from the scorecard could be taken from regression model.