Skip to content

Commit

Permalink
fix #267
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedb committed Mar 31, 2024
1 parent 6e92369 commit a791fe5
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions test/MLJ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a791fe5

Please sign in to comment.