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

quantile_biner #112

Open
tatasz opened this issue Dec 27, 2019 · 0 comments
Open

quantile_biner #112

tatasz opened this issue Dec 27, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@tatasz
Copy link
Contributor

tatasz commented Dec 27, 2019

Instructions

Quantile biner creates an extra class either for min or for max.

Code sample

test = pd.DataFrame({
    "id": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    "value": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
})

transformation.quantile_biner(test, columns_to_bin=['value'], q=2, right=False)[1]

Problem description

This will result in 3 classes, with the min value in a separate class if right=True, and max value in a separate class otherwise.

If fact, it creates an extra class for min or max for all the values of q (both int and list of quantiles).

Expected behavior

Behave like pd.qcut, when setting q=n will create exactly n classes.

Possible solutions

include min and max values in the extreme intervals, regardless the right setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant