-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Context: JuliaAI/MLJ.jl#1182 (comment)
using MLJ
using MLJTestIntegration
A = @load KernelPerceptronClassifier
X, y = MLJTestIntegration.datasets(A)[1];
mach = machine(A(), X, y)
MLJ.fit!(mach, rows=1:4);
MLJ.predict(mach, X)
# ERROR: xtrain, ytrain or α have a length not compatible with the number of classes in this model.
# Stacktrace:
# [1] error(s::String)
# @ Base ./error.jl:35
# [2] predict(x::Matrix{…}, xtrain::Vector{…}, ytrain::Vector{…}, α::Vector{…}, classes::Vector{…}; K::typeof(radial_kernel))
# @ BetaML.Perceptron ~/.julia/packages/BetaML/GVo1h/src/Perceptron/Perceptron_kernel.jl:268
# [3] predict
# @ ~/.julia/packages/BetaML/GVo1h/src/Perceptron/Perceptron_kernel.jl:259 [inlined]
# [4] predict(model::BetaML.Bmlj.KernelPerceptronClassifier, fitresult::Tuple{…}, Xnew::@NamedTuple{…})
# @ BetaML.Bmlj ~/.julia/packages/BetaML/GVo1h/src/Bmlj/Perceptron_mlj.jl:285
# [5] predict(mach::Machine{…}, Xraw::@NamedTuple{…})
# @ MLJBase ~/.julia/packages/MLJBase/F8Zzu/src/operations.jl:135
# [6] top-level scope
# @ REPL[55]:1
# Some type information was truncated. Use `show(err)` to see complete types.This looks like only levels explicitly seen in training (and not the complete categorical pool) are being to recorded in the train. I see that there was some unwrapping added in the last release, which I suppose is the cause.
If I recall correctly, the recent patch was to anticipate changes to CategoricalArrays.jl (which MLJ has not addressed). Did the baby get thrown out with the bathwater?
Metadata
Metadata
Assignees
Labels
No labels