We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This bug is due to a recent Base update, and it causes the test failure of Distributions.jl
Related code: (https://github.com/JuliaStats/Distributions.jl/blob/master/src/univariate/categorical.jl#L225)
function fit_mle{T<:Integer}(::Type{Categorical}, k::Integer, x::Array{T}) Categorical(normalize!(add_categorical_counts!(zeros(k), x), 1), NoArgCheck()) end fit_mle{T<:Integer}(::Type{Categorical}, data::(Int, Array{T})) = fit_mle(Categorical, data...)
Then in Julia:
julia> using Distributions julia> x = rand(1:3, 10); julia> fit_mle(Categorical, 3, x) Categorical( K=3 prob=[0.7000000000000001, 0.30000000000000004, 0.0] ) julia> fit_mle(Categorical, (3, x)) Binomial( size=3 prob=0.43333333333333335 )
However, it I change the last fit_mle method to
fit_mle
fit_mle{T<:Integer}(::Type{Categorical}, data::(Int, Array{T})) = fit_mle(Categorical, data[1], data[2])
Then it works correctly.
It is very weird why fit_mle(Categorical, data...) calls a wrong method, while fit_mle(Categorical, data[1], data[2]) is correct.
fit_mle(Categorical, data...)
fit_mle(Categorical, data[1], data[2])
Related to JuliaStats/Distributions.jl#198
cc: @JeffBezanson @StefanKarpinski
The text was updated successfully, but these errors were encountered:
Using git bisect, I figured the commit that causes this bug: 9718fcf
git bisect
Sorry, something went wrong.
Thanks for doing the bisect.
9b2cac8
JeffBezanson
No branches or pull requests
This bug is due to a recent Base update, and it causes the test failure of Distributions.jl
Related code: (https://github.com/JuliaStats/Distributions.jl/blob/master/src/univariate/categorical.jl#L225)
Then in Julia:
However, it I change the last
fit_mle
method toThen it works correctly.
It is very weird why
fit_mle(Categorical, data...)
calls a wrong method, whilefit_mle(Categorical, data[1], data[2])
is correct.Related to JuliaStats/Distributions.jl#198
cc: @JeffBezanson @StefanKarpinski
The text was updated successfully, but these errors were encountered: