Hello,
I try to caculate a confusion matrix in Julia, but I meet some ERROR and it is hard for me to debug, any suggestion? Thanks you.
here is my code
using MLJ, CategoricalArrays
# Status `~/.julia/environments/v1.7/Project.toml`
# [324d7699] CategoricalArrays v0.8.3
# [add582a8] MLJ v0.16.5
yHat = categorical(["A", "B", "A"], ordered=true)
yOrig = categorical(["A", "B", "B"], ordered=true)
confusion_matrix(yHat,yOrig)
but these code ouput error:
ERROR: TypeError: non-boolean (Nothing) used in boolean context
Stacktrace:
[1] _confmat(Ε·::CategoricalVector{String, UInt32, String, CategoricalValue{String, UInt32}, Union{}}, y::CategoricalVector{String, UInt32, String, CategoricalValue{String, UInt32}, Union{}}; rev::Nothing, perm::Nothing, warn::Bool)
@ MLJBase ~/.julia/packages/MLJBase/hLtde/src/measures/confusion_matrix.jl:98
[2] (::ConfusionMatrix)(Ε·::CategoricalVector{String, UInt32, String, CategoricalValue{String, UInt32}, Union{}}, y::CategoricalVector{String, UInt32, String, CategoricalValue{String, UInt32}, Union{}})
@ MLJBase ~/.julia/packages/MLJBase/hLtde/src/measures/confusion_matrix.jl:232
[3] top-level scope
@ REPL[9]:1
And I have try the similar solution in another related answer, and I got the same error. I meet this problem with both julia V1.6 and V1.7
Thank for you reading and help.