Jim Maas
Jim Maas

Reputation: 1729

Julia MLJ not loading correctly

I'm at the install/testing phase of Julia and attempting to run the Iris example MLJ Example of training a model using the Julia MLJ. I think I have it installed properly but am getting this error. What have I done incorrectly? Thx. J

julia> Tree = @load DecisionTreeClassifier pkg=DecisionTree
DecisionTreeClassifier(
    max_depth = -1,
    min_samples_leaf = 1,
    min_samples_split = 2,
    min_purity_increase = 0.0,
    n_subfeatures = 0,
    post_prune = false,
    merge_purity_threshold = 1.0,
    pdf_smoothing = 0.0,
    display_depth = 5,
    rng = Random._GLOBAL_RNG()) @726

julia> tree = Tree()
ERROR: MethodError: no method matching (::MLJDecisionTreeInterface.DecisionTreeClassifier)()
Closest candidates are:
  (::Supervised)(::Tuple{AbstractMatrix{T} where T, Any}) at /home/name/.julia/packages/MLJBase/8HFqb/src/composition/learning_networks/arrows.jl:25
  (::Supervised)(::Tuple{AbstractNode, AbstractNode}) at /home/name/.julia/packages/MLJBase/8HFqb/src/composition/learning_networks/arrows.jl:21
  (::Supervised)(::Tuple{AbstractNode, Any}) at /home/name/.julia/packages/MLJBase/8HFqb/src/composition/learning_networks/arrows.jl:22
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

Upvotes: 1

Views: 145

Answers (1)

Jim Maas
Jim Maas

Reputation: 1729

I found the problem, old and un-updateable versions of some packages. So I moved copies of ~/.julia/environments/v1.6/Manifest.toml and Project.toml to another directory for storage, restarted julia, reinstalled the packages MLJ and MLJDecisionTreeInterface, and this time got the most recent versions. Now the code runs fine.

Upvotes: 1

Related Questions