JuliaStats / GLMNet.jl

Julia wrapper for fitting Lasso/ElasticNet GLM models using glmnet
Other
96 stars 35 forks source link

MethodError: glmnet(::Array{Float64,2}, ::Array{Int64,1}) is ambiguous #55

Closed arisliang closed 3 years ago

arisliang commented 3 years ago

From basic regression model from quick start https://github.com/JuliaStats/GLMNet.jl, if y is of type Array{Int64,1}.

glmnet will give ambiguous error

ERROR: MethodError: glmnet(::Array{Float64,2}, ::Array{Int64,1}) is ambiguous. Candidates: glmnet(X::Array{Float64,2}, y; kw...) in GLMNet at C:\Users\ly.julia\packages\GLMNet\1uQom\src\Multinomial.jl:191 glmnet(X::AbstractArray{T,2} where T, y::AbstractArray{var"#s77",1} where var"#s77"<:Number) in GLMNet at C:\Users\ly.julia\packages\GLMNet\1uQom\src\GLMNet.jl:492 Possible fix, define glmnet(::Array{Float64,2}, ::AbstractArray{var"#s77",1} where var"#s77"<:Number)