Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug in sklift/metrics.py uplift_curve and qini_curve functions #208

Open
esko1779 opened this issue Apr 24, 2023 · 0 comments
Open

Comments

@esko1779
Copy link

esko1779 commented Apr 24, 2023

🐛 Bug

The variable distinct_value_indices is now computed as np.where(np.diff(uplift))[0]. It's not a good idea, in my opinion, and it returned me a wrong set of indices for my array. The problem is that the difference of two identical floats can equal to smth like 1e-17, not 0, thus this method will miss this problem. And unfortunately it may be the case if, for example, I want to train two models by myself, then calculate the difference of the scores and then calculate the quality of such a model (two-model approach, but not using sklift's objects). Maybe it's worth to just add a tolerance: np.argwhere(np.abs(np.diff(uplift_desc)) > tol).ravel().

To Reproduce

Too hard to reproduce actually, but if you really want me to do it, I'll provide the code.

Expected behavior

See the description of the bug.

Environment

Latest version, Python3.10, Win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant