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

Strange cut for imbalanced distributions #382

Open
bkamins opened this issue Feb 25, 2022 · 1 comment
Open

Strange cut for imbalanced distributions #382

bkamins opened this issue Feb 25, 2022 · 1 comment

Comments

@bkamins
Copy link
Member

bkamins commented Feb 25, 2022

I find this result strange:

julia> cut([fill(1, 10); 4], 2)
11-element CategoricalArray{String,1,UInt32}:
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"

julia> cut([fill(1, 10); 4], 3, allowempty=true)
11-element CategoricalArray{String,1,UInt32}:
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
 "Q2: [1.0, 4.0]"
@bkamins
Copy link
Member Author

bkamins commented Feb 25, 2022

julia> cut([fill(1, 5); fill(4,5)], 2)
10-element CategoricalArray{String,1,UInt32}:
 "Q1: [1.0, 2.5)"
 "Q1: [1.0, 2.5)"
 "Q1: [1.0, 2.5)"
 "Q1: [1.0, 2.5)"
 "Q1: [1.0, 2.5)"
 "Q2: [2.5, 4.0]"
 "Q2: [2.5, 4.0]"
 "Q2: [2.5, 4.0]"
 "Q2: [2.5, 4.0]"
 "Q2: [2.5, 4.0]"

julia> cut([fill(1, 5); fill(4,5)], 3)
10-element CategoricalArray{String,1,UInt32}:
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"
 "Q1: [1.0, 4.0]"

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