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

Tutorial not working #951

Closed
davibarreira opened this issue Jun 29, 2022 · 5 comments
Closed

Tutorial not working #951

davibarreira opened this issue Jun 29, 2022 · 5 comments

Comments

@davibarreira
Copy link

davibarreira commented Jun 29, 2022

Describe the bug
The tutorial here errors when
one tries to run DecisionTree = @load DecisionTreeClassifier pkg=DecisionTree.
The error actually seems to be in the MLJDecisionTreeInterface.

To Reproduce

using MLJ
using MLJDecisionTreeInterface

It throws an error:

[ Info: Precompiling MLJDecisionTreeInterface [c6f25543-311c-4c74-83dc-3ea6d1015661]
ERROR: LoadError: MethodError: no method matching metadata_model(::Type{MLJDecisionTreeInterface.DecisionTreeClassifier}; input_scitype=ScientificTypesBase.Table{<:Union{AbstractVector{<:ScientificTypesBase.Continuous}, AbstractVector{<:ScientificTypesBase.Count}, AbstractVector{<:ScientificTypesBase.OrderedFactor}}}, target_scitype=AbstractVector{<:ScientificTypesBase.Finite}, human_name="CART decision tree classifier", load_path="MLJDecisionTreeInterface.DecisionTreeClassifier")
Closest candidates are:
  metadata_model(::Any; input, target, output, weights, descr, path, input_scitype, target_scitype, output_scitype, supports_weights, docstring, load_path) at ~/.julia/packages/MLJModelInterface/43ITU/src/metadata_utils.jl:100 got unsupported keyword argument "human_name"
Stacktrace:
 [1] kwerr(::NamedTuple{(:input_scitype, :target_scitype, :human_name, :load_path), Tuple{UnionAll, UnionAll, String, String}}, ::Function, ::Type)
   @ Base ./error.jl:163
 [2] top-level scope
   @ ~/.julia/packages/MLJDecisionTreeInterface/Wf8wO/src/MLJDecisionTreeInterface.jl:282
 [3] include
   @ ./Base.jl:418 [inlined]
 [4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base ./loading.jl:1318
 [5] top-level scope
   @ none:1
 [6] eval
   @ ./boot.jl:373 [inlined]
 [7] eval(x::Expr)
   @ Base.MainInclude ./client.jl:453
 [8] top-level scope
   @ none:1
in expression starting at /home/davibarreira/.julia/packages/MLJDecisionTreeInterface/Wf8wO/src/MLJDecisionTreeInterface.jl:1
ERROR: Failed to precompile MLJDecisionTreeInterface [c6f25543-311c-4c74-83dc-3ea6d1015661] to /home/davibarreira/.julia/compiled/v1.7/MLJDecisionTreeInterface/jl_s1PPP1.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997

Expected behavior
The package does not import.

Versions
julia 1.7.2

MLJ v0.17.1

MLJDecisionTreeInterface v0.1.4

@ablaom
Copy link
Member

ablaom commented Jun 29, 2022

@davibarreira Thanks for reporting. I'm not sure what the cause is, but this error does not appear for me when using latest versions of MLJ/MLJDecisionTreeInterface. Can you please report the output of using Pkg; Pkg.status() so I can see all the package versions?

In the meantime, this tutorial almost certainly works if you activate the environment defined by the files Project.toml/Manifest.toml that appear in the same folder as that tutorial. See also https://juliaai.github.io/DataScienceTutorials.jl/end-to-end/telco/ which has links to instructions for doing this.

@OkonSamuel
Copy link
Member

Yes, this is indeed a dependency issue. The culprit is "MLJModelInterface".
@ablaom This issue occurs because the human_name trait was only just recently added to MLJModelInterface@v1.4.0 metadata_model function (see here) but MLJDecisionTreeInterface@v0.1.4 used this functionality and wrongly specified a loose bound for MLJModelInterface.jl dependency in its Project.toml file as "1.0" instead of "1.4.0". see here.

A temporary fix is just to run ] up MLJDecisionTreeInterface

@davibarreira
Copy link
Author

Thanks!

@ablaom
Copy link
Member

ablaom commented Jun 30, 2022

@OkonSamuel Great catch. We need to pull 0.1.4, 0.2.0, 0.2.1 from the registry. I'll make a PR shortly.

@ablaom
Copy link
Member

ablaom commented Jun 30, 2022

Only 0.1.4 was not already yanked. The General.jl PR above should sort this.

Thanks again @davibarreira for reporting.

@ablaom ablaom closed this as completed Jun 30, 2022
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

3 participants