-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix for woe_1d, plus minor cosmetic and test issues (#98)
* Fix for pd.Series input to woe_1d The woe_1d function wasn't running y.reset_index() in the case where its y input was already a pd.Series. This meant that it would return incorrect values when indexes in X and y were noncontinuous. Added a check for this condition to tests/test_metrics.py as well. * Fix negative IV values in summary tables The scikit-learn WOEEncoder uses ln(%bad / %good) instead of ln(%good / %bad) for some reason, which flips all of the signs. A previous fix switched the computation of WOE in the summary table to match. However, this fix caused the IV values to be negative in summary tables, which I found surprising. I added an abs() call to the IV calculation to correct this cosmetic defect. * DataFrame.append was removed in pandas 2.0 Tests were failing in Pandas 2.0 due to the use of DataFrame.append, which has been removed. I fixed it by changing this to a pd.concat call. --------- Co-authored-by: Reinier Koops <[email protected]>
- Loading branch information
Showing
5 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters