ing-bank / skorecard

scikit-learn compatible tools for building credit risk acceptance models
https://ing-bank.github.io/skorecard/
MIT License
84 stars 23 forks source link

bucket_table()-method WoE-inconsistency #87

Closed dlaprins closed 1 year ago

dlaprins commented 1 year ago

The Skorecard object has a bucket_table() method which showcases WoE-values per bucket. This feature is quite useful for reporting. Unfortunately, the WoE-values in the table are inconsistent with the WoE-values that are obtained by applying the Skorecard's woe_transform() method to the feature.

The latter values, which are also used when predicting, are obtained from category_encoders WoE-transform. The former are implemented by hand in line 126 of skorecard.reporting.report.py. The difference lies in the way that the regularisation-factor epsilon is implemented in both cases (not just the value of epsilon, but also where it shows up in the equation for the WoE).