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

TypeError: in keyword argument watchlist #46

Closed
rikhuijzer opened this issue Nov 21, 2023 · 3 comments · Fixed by #48
Closed

TypeError: in keyword argument watchlist #46

rikhuijzer opened this issue Nov 21, 2023 · 3 comments · Fixed by #48

Comments

@rikhuijzer
Copy link
Member

rikhuijzer commented Nov 21, 2023

When running the tests of this package, I get an error:

┌ Error: Problem fitting the machine machine(XGBoostClassifier(test = 1, …), …).
└ @ MLJBase ~/.julia/packages/MLJBase/fEiP2/src/machines.jl:682
[ Info: Running type checks...
[ Info: Type checks okay.
Binary Classification: Error During Test at /Users/rik/git/MLJXGBoostInterface.jl/test/runtests.jl:14
  Got exception outside of a @test
  TypeError: in keyword argument watchlist, expected AbstractDict, got a value of type NamedTuple{(), Tuple{}}
  Stacktrace:
    [1] fit(model::XGBoostClassifier, verbosity::Int64, X::NamedTuple{(:x1, :x2, :x3), Tuple{Vector{Float64}, Vector{Float64}, Vector{Float64}}}, y::CategoricalArrays.CategoricalVector{String, UInt32, String, CategoricalArrays.CategoricalValue{String, UInt32}, Union{}})
      @ MLJXGBoostInterface ~/git/MLJXGBoostInterface.jl/src/MLJXGBoostInterface.jl:165
    [2] fit_only!(mach::Machine{XGBoostClassifier, true}; rows::Nothing, verbosity::Int64, force::Bool, composite::Nothing)
      @ MLJBase ~/.julia/packages/MLJBase/fEiP2/src/machines.jl:680
    [3] fit_only!
      @ ~/.julia/packages/MLJBase/fEiP2/src/machines.jl:606 [inlined]
    [4] #fit!#63
      @ ~/.julia/packages/MLJBase/fEiP2/src/machines.jl:777 [inlined]
    [5] macro expansion
      @ ~/git/MLJXGBoostInterface.jl/test/runtests.jl:28 [inlined]
    [6] macro expansion
      @ ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
    [7] top-level scope
      @ ~/git/MLJXGBoostInterface.jl/test/runtests.jl:15
    [8] include(fname::String)
      @ Base.MainInclude ./client.jl:478
    [9] top-level scope
      @ none:6
   [10] eval
      @ ./boot.jl:370 [inlined]
   [11] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:280
   [12] _start()
      @ Base ./client.jl:522
Test Summary:         | Error  Total  Time
Binary Classification |     1      1  3.1s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/rik/git/MLJXGBoostInterface.jl/test/runtests.jl:14
ERROR: Package MLJXGBoostInterface errored during testing

I'm opening this issue because this thing will probably come back even after we fix it because not everyone will run the same versions.

I'm investigating. The cause looks dmlc/XGBoost.jl#193. It looks like it should probably be fixed at the XGBoost.jl side.

@ExpandingMan
Copy link
Collaborator

Sorry, this is my fault when I merged that. I will write a PR to get it to accept either AbstractDict or NamedTuple.

@ExpandingMan
Copy link
Collaborator

This patch should restore functionality for NamedTuple.

@ablaom
Copy link
Member

ablaom commented Nov 21, 2023

@rikhuijzer Can this be closed in view of #47 ?

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

Successfully merging a pull request may close this issue.

3 participants