-
Notifications
You must be signed in to change notification settings - Fork 35
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
Comments
|
#410 fixes this, but not necessarily in the most convenient/intuitive way: julia> cut([fill(1, 10); 4], 2)
ERROR: ArgumentError: cannot compute 2 quantiles: `quantile` returned only 1 group(s) due to duplicated values in `x`. Pass `allowempty=true` to allow empty quantiles or choose a lower value for `ngroups`.
Stacktrace:
[1] cut(x::Vector{Int64}, ngroups::Int64; labels::typeof(CategoricalArrays.quantile_formatter), allowempty::Bool)
@ CategoricalArrays ~/.julia/dev/CategoricalArrays/src/extras.jl:262
[2] cut(x::Vector{Int64}, ngroups::Int64)
@ CategoricalArrays ~/.julia/dev/CategoricalArrays/src/extras.jl:251
[3] top-level scope
@ REPL[272]:1
julia> cut([fill(1, 10); 4], 3, allowempty=true)
11-element CategoricalArray{String,1,UInt32}:
"Q3: [1.0, 4.0]"
"Q3: [1.0, 4.0]"
"Q3: [1.0, 4.0]"
⋮
"Q3: [1.0, 4.0]"
"Q3: [1.0, 4.0]"
"Q3: [1.0, 4.0]"
julia> levels(ans)
3-element Vector{String}:
"Q1: (1.0, 1.0)"
"Q2: (1.0, 1.0)"
"Q3: [1.0, 4.0]" It would probably be more useful to have classes be |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I find this result strange:
The text was updated successfully, but these errors were encountered: