Skip to content

Commit

Permalink
Add brackets to fix woe calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
kiraplenkin committed Sep 17, 2022
1 parent b7822d7 commit 6181354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion woe_scoring/core/binning/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _calc_stats(
bad_rate = bad / total if total != 0 else 0
good = total - bad
woe = np.log((good / all_good) / (bad / all_bad)) if good != 0 and bad != 0 else np.log(
(good + 0.5 / all_good) / (bad + 0.5 / all_bad)
((good + 0.5) / all_good) / ((bad + 0.5) / all_bad)
)
iv = ((good / all_good) - (bad / all_bad)) * woe
return {
Expand Down

0 comments on commit 6181354

Please sign in to comment.