-
Notifications
You must be signed in to change notification settings - Fork 156
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
Missing package dependency? #204
Comments
Adding
|
Finally, after installing all the packages I get the following: julia> fit!(tree, rows=train)
[ Info: Training Machine{DecisionTreeClassifier} @ 1…94.
ERROR: MethodError: no method matching build_tree(::CategoricalArray{String,1,UInt8,String,CategoricalString{UInt8},Union{}}, ::Array{Float64,2}, ::Float64, ::Int64, ::Int64, ::Int64, ::Float64)
Closest candidates are:
build_tree(::Array{T<:Float64,1}, ::Array{S,2}, ::Any, ::Any, ::Any, ::Any, ::Any; rng) where {S, T<:Float64} at /Users/dpsanders/.julia/packages/DecisionTree/nfB7O/src/regression/main.jl:27
build_tree(::Array{T,1}, ::Array{S,2}, ::Any, ::Any, ::Any, ::Any, ::Any; rng) where {S, T} at /Users/dpsanders/.julia/packages/DecisionTree/nfB7O/src/classification/main.jl:83
build_tree(::Array{T<:Float64,1}, ::Array{S,2}, ::Any, ::Any, ::Any, ::Any) where {S, T<:Float64} at /Users/dpsanders/.julia/packages/DecisionTree/nfB7O/src/regression/main.jl:27
...
Stacktrace:
[1] fit(::DecisionTreeClassifier, ::Int64, ::DataFrame, ::CategoricalArray{String,1,UInt8,String,CategoricalString{UInt8},Union{}}) at /Users/dpsanders/.julia/packages/MLJModels/p7doS/src/DecisionTree.jl:110
[2] #fit!#3(::Array{Int64,1}, ::Int64, ::Bool, ::Function, ::Machine{DecisionTreeClassifier}) at /Users/dpsanders/.julia/packages/MLJ/HXakA/src/machines.jl:131
[3] (::getfield(StatsBase, Symbol("#kw##fit!")))(::NamedTuple{(:rows,),Tuple{Array{Int64,1}}}, ::typeof(fit!), ::Machine{DecisionTreeClassifier}) at ./none:0
[4] top-level scope at none:0 |
I also share this view that the default installation feels incomplete. Instead of an error I think one could at least ask the user if he desires to install the dependency on the fly. Regarding the last error, please make sure that you are calling the right version of |
@dpsanders Can you check the versions of CategoricalArrays in your project manifest? Eg, do The error you report is a known issue unless CategoricalArrays = "<0.5.3". If you update MLJ to latest tagged release, this should go away. If not trying updating MLJBase first. Let me know if this persists. |
Already there: We could make MLJModels an explicit dependency of MLJ, so that even this is unnecessary. The original idea was that external packages implement their own MLJ interface natively; MLJModels is supposed to be a temporary hack. It hasn't worked out that way yet, however. Regarding this:
This sounds like an informative message to me. I don't see how an initial "fail" can be avoided, without either: (i) making |
The version of CategoricalArrays is 0.5.5. Prompting to install the needed package is a great suggestion. I guess I was just expecting to be able to copy and paste code from https://alan-turing-institute.github.io/MLJ.jl/dev/ and have it work. Maybe it's just as simple as adding the relevant Pkg commands directly in the "Getting started" text. Thanks! |
DataFrames is restricting CategoricalArrays to 0.5.4--0.5.5, and that is not allowing MLJ to update apparently. |
I finally successfully pinned CategoricalArrays to 0.5.2 and then all the MLJ packages update to the latest version and everything works. Thanks! |
(I don't see that info in the docs though?) |
Closing as this seems to me a package-management issue, not an MLJ one. Some extra comments added to documentation in #206 to clarify need add external packages to the user's environment. |
Is it because MLJ that my DataFrames is downgraded?
|
I expect the issue is that MLJBase requires CategoricalArrays = "<0.5.3" because of this unresolved issue: JuliaData/CategoricalArrays.jl#199 |
Thanks. |
You can pin Missings to 0.4.1 to get rid of annoying warning about nonmissingtype. |
Describe the bug
Following the README gives an error with a missing package.
To Reproduce
In a clean installation, install
MLJ
andRDatasets
and try to run the code inhttps://github.com/alan-turing-institute/MLJ.jl/blob/master/docs/src/index.md up to
@load DecisionTreeClassifier
.Expected behavior
Either this should work, or the step
using MLJModels
should be added in the README.Versions
MLJ v0.2.3
The text was updated successfully, but these errors were encountered: