Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
matrix:
version:
- '1.6'
- '1.10'
- '1' # automatically expands to the latest stable 1.x release of Julia.
os:
- ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions src/MLJTestInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const N_MODELS_FOR_REPEATABILITY_TEST = 20
using MLJBase
using Pkg
using Test
import MLJBase.CategoricalArrays.unwrap

include("attemptors.jl")
include("test.jl")
Expand Down
13 changes: 12 additions & 1 deletion src/attemptors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,21 @@ function operations(fitted_machine, data...; throw=false, verbosity=1)
methods = MLJBase.implemented_methods(fitted_machine.model)
_, test = MLJBase.partition(1:MLJBase.nrows(first(data)), 0.01)
if :predict in methods
predict(fitted_machine, first(data))
yhat = predict(fitted_machine, first(data))
model isa Static || predict(fitted_machine, rows=test)
model isa Static || predict(fitted_machine, rows=:)
push!(operations, "predict")

# check for double wrapped CategoricalValues in predict output for
# classifiers:
if target_scitype(model) <: AbstractVector{<:Finite} &&
model isa Union{Deterministic,Probabilistic}
η = model isa Deterministic ? first(yhat) : rand(first(yhat))
unwrap(η) isa MLJBase.CategoricalArrays.CategoricalValue &&
error("Doubly wrapped CategoricalValue encountered. Check use of "*
"CategoricalArrays methods `levels` and `unique`, which changed in "*
"version 1.0. ")
end
end
if :transform in methods
W = if model isa Static
Expand Down
Loading