From a791fe5f7aac38f23783009998ec4e6fec4718db Mon Sep 17 00:00:00 2001 From: jeremie Date: Sun, 31 Mar 2024 15:52:57 -0400 Subject: [PATCH] fix #267 --- test/MLJ.jl | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/test/MLJ.jl b/test/MLJ.jl index 9a7b225..8a63d70 100644 --- a/test/MLJ.jl +++ b/test/MLJ.jl @@ -401,17 +401,11 @@ end ################################################## ### issue #267: ordered target ################################################## -using CategoricalArrays -y = categorical(collect("cbbba"), levels=['b', 'a', 'c'], ordered=true) -lvls = levels(y) -eltype(y) <: CategoricalValue -isordered(y) - -using MLJBase, EvoTrees -# using StatisticalMeasures -X = (; x=rand(10)) -y = coerce(rand("ab", 10), OrderedFactor) -model = EvoTreeClassifier() -mach = machine(model, X, y) |> fit! -yhat = predict(mach, X) -@assert isordered(yhat) +@testset "MLJ - supported ordered factor predictions" begin + X = (; x=rand(10)) + y = coerce(rand("ab", 10), OrderedFactor) + model = EvoTreeClassifier() + mach = machine(model, X, y) |> fit! + yhat = predict(mach, X) + @assert isordered(yhat) +end