fix total metric changing with different num bins when using quantile binning on diabetes dataset #1233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix total metric changing with different num bins when using quantile binning on diabetes dataset.
Fixes issue:
#1217
This was fixed by re-binning the quantile binned dataset, as for low precision values pd.qcut miscategorizes data. This is partly fixed by setting the PRECISION parameter to pd.qcut, but it seems for some datasets even lowest precision still has miscategorizations.
Specifically, it can bin some points incorrectly for low precision, for example a point with value
-0.0127796318808497
will be binned incorrectly in interval
(-0.0309423241359475, -0.012779631880849702]
even though it should be binned in the interval above since
-0.0127796318808497 > -0.012779631880849702
Also, during testing I discovered another error, which is also fixed in this PR. This other error is caused by the first quantile bin being incorrectly resized for negative values. For more detailed information please see PR:
#898
Which has a description of some of the limitations of pd.qcut due to the interval brackets. Calculating abs fixes this issue. For the error message please see below:
Areas changed
npm packages changed:
Python packages changed:
Tests
Screenshots (if appropriate):
Documentation: