You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
┌ Warning: Levels not explicitly ordered. Using the order [0, 1]. The "positive" level is 1.
└ @ StatisticalMeasures.ConfusionMatrices [~/.julia/packages/StatisticalMeasures/NoDLI/src/confusion_matrices.jl:333](https://vscode-remote+ssh-002dremote-002bivosrv6.vscode-resource.vscode-cdn.net/home/lyx/projects/rules/~/.julia/packages/StatisticalMeasures/NoDLI/src/confusion_matrices.jl:333)
Many other measures have similar behavior. I try to add warn=false keyword (which was found in the above mentioned confusion_matrices.jl but without success.
Is there any easy way to get rid of this warning. Or better, how can I correctly set the levels to eliminate the warning? I try a lot of ways but failed. Thanks!
The text was updated successfully, but these errors were encountered:
using StatisticalMeasures
# option 1: Use categorical arrays for categorical data (recommended throughout MLJ ecosystem)using CategoricalArrays
yt =categorical(yt, ordered=true) # ordered 0, 1
yp =categorical(yp, ordered=true)
cm =confmat(yp, yt)
PositivePredictiveValue()(cm)
# 0.5306122448979591# option 2: Notice `confmat` is just alias for `ConfusionMatrix()`, which has `levels` as# an option; see its docstring.
yt =Int.(rand(100) .>0.5)
yp =Int.(rand(100) .>0.5)
confmat2 =ConfusionMatrix(levels=[0, 1]) # negative class first
cm =confmat2(yp, yt)
PositivePredictiveValue()(cm)
# 0.5306122448979591
I am using MLJ v0.20.2 with StatisticalMeasures.jl v0.1.3.
which emitts a warning:
Many other measures have similar behavior. I try to add
warn=false
keyword (which was found in the above mentioned confusion_matrices.jl but without success.Is there any easy way to get rid of this warning. Or better, how can I correctly set the levels to eliminate the warning? I try a lot of ways but failed. Thanks!
The text was updated successfully, but these errors were encountered: