SVM Errors With Grid Search

The full error is:

Error of SVM Model fitting
┌ Error: Problem fitting the machine Machine{Resampler{CV},…}. 
└ @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:533
[ Info: Running type checks... 
[ Info: Type checks okay. 
┌ Error: Problem fitting the machine Machine{DeterministicTunedModel{Grid,…},…}. 
└ @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:533
[ Info: Running type checks... 
[ Info: Type checks okay. 
ERROR: LoadError: TypeError: in CategoricalValue, in T, expected T<:Union{AbstractChar, AbstractString, Number}, got Type{Any}
Stacktrace:
   [1] argtypes_to_type
     @ ./compiler/typeutils.jl:50 [inlined]
   [2] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1032
   [3] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
   [4] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
   [5] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
   [6] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
   [7] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
   [8] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
   [9] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [10] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [11] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [12] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [13] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
--- the last 11 lines are repeated 1 more time ---
  [25] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [26] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [27] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [28] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [29] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [30] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [31] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [32] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [33] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [34] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [35] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
  [36] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [37] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [38] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [39] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [40] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [41] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [42] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [43] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [44] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [45] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Nothing, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [46] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Nothing, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [47] abstract_apply(interp::Core.Compiler.NativeInterpreter, itft::Any, aft::Any, aargtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:738
  [48] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:952
  [49] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [50] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [51] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [52] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [53] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [54] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [55] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [56] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [57] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [58] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [59] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [60] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [61] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [62] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [63] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [64] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [65] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [66] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [67] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [68] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [69] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [70] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
  [71] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [72] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [73] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [74] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [75] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [76] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [77] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [78] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [79] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [80] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [81] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
--- the last 11 lines are repeated 1 more time ---
  [93] abstract_apply(interp::Core.Compiler.NativeInterpreter, itft::Any, aft::Any, aargtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:738
  [94] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:952
  [95] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [96] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [97] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [98] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [99] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [100] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [101] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [102] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [103] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [104] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [105] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
--- the last 11 lines are repeated 1 more time ---
 [117] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
 [118] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [119] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [120] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
 [121] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [122] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [123] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [124] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [125] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [126] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [127] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
 [128] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [129] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [130] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
 [131] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [132] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [133] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [134] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [135] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [136] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [137] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
 [138] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
 [139] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [140] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [141] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1447
 [142] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [143] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [144] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [145] typeinf
     @ ./compiler/typeinfer.jl:8 [inlined]
 [146] typeinf_type(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector)
     @ Core.Compiler ./compiler/typeinfer.jl:914
 [147] return_type(interp::Core.Compiler.NativeInterpreter, f::Any, t::Any)
     @ Core.Compiler ./compiler/typeinfer.jl:963
 [148] return_type(f::Any, t::Any, world::UInt64)
     @ Core.Compiler ./compiler/typeinfer.jl:950
 [149] return_type(f::Any, t::Any)
     @ Core.Compiler ./compiler/typeinfer.jl:947
 [150] macro expansion
     @ ./array.jl:652 [inlined]
 [151] dict_with_eltype(DT_apply::F, kv::Base.Generator, t::Any) where F
     @ Base ./abstractdict.jl:541
 [152] Dict(kv::Any)
     @ Base ./dict.jl:129
 [153] (::MLJBase.var"#fit_and_extract_on_fold#299")(mach::Any, k::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1086
 [154] (::MLJBase.var"#276#277")(k::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:927
 [155] mapreduce_impl(f::Any, op::Any, A::Union{Base.AbstractBroadcasted, AbstractArray}, ifirst::Integer, ilast::Integer, blksize::Int64)
     @ Base ./reduce.jl:242
 [156] mapreduce_impl(f::Function, op::Function, A::UnitRange{Int64}, ifirst::Int64, ilast::Int64)
     @ Base ./reduce.jl:257
 [157] _mapreduce(f::Any, op::Any, #unused#::IndexLinear, A::Union{Base.AbstractBroadcasted, AbstractArray})
     @ Base ./reduce.jl:415
 [158] _mapreduce_dim(f::Function, op::Function, #unused#::Base._InitialValue, A::UnitRange{Int64}, #unused#::Colon)
     @ Base ./reducedim.jl:318
 [159] #mapreduce#672
     @ ./reducedim.jl:310 [inlined]
 [160] mapreduce(f::Function, op::Function, A::UnitRange{Int64})
     @ Base ./reducedim.jl:310
 [161] _evaluate!(func::Any, mach::Any, #unused#::CPU1, nfolds::Any, verbosity::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:926
 [162] evaluate!(mach::Machine{MLJScikitLearnInterface.SVMClassifier, true}, resampling::Vector{Tuple{Vector{Int64}, UnitRange{Int64}}}, weights::Nothing, class_weights::Nothing, rows::Nothing, verbosity::Int64, repeats::Int64, measures::Vector{Accuracy}, operations::Vector{typeof(predict)}, acceleration::CPU1{Nothing}, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1121
 [163] evaluate!(::Machine{MLJScikitLearnInterface.SVMClassifier, true}, ::CV, ::Nothing, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Vector{Accuracy}, ::Vector{typeof(predict)}, ::CPU1{Nothing}, ::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1188
 [164] fit(::Resampler{CV}, ::Int64, ::DataFrame, ::CategoricalVector{Int64, UInt32, Int64, CategoricalValue{Int64, UInt32}, Union{}})
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1332
 [165] fit_only!(mach::Machine{Resampler{CV}, false}; rows::Nothing, verbosity::Int64, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:531
 [166] #fit!#103
     @ ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:598 [inlined]
 [167] event!(metamodel::MLJScikitLearnInterface.SVMClassifier, resampling_machine::Machine{Resampler{CV}, false}, verbosity::Int64, tuning::Grid, history::Nothing, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:390
 [168] #35
     @ ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:428 [inlined]
 [169] iterate
     @ ./generator.jl:47 [inlined]
 [170] _collect(c::Vector{MLJScikitLearnInterface.SVMClassifier}, itr::Base.Generator{Vector{MLJScikitLearnInterface.SVMClassifier}, MLJTuning.var"#35#36"{Machine{Resampler{CV}, false}, Int64, Grid, Nothing, NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, ProgressMeter.Progress}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
     @ Base ./array.jl:691
 [171] collect_similar
     @ ./array.jl:606 [inlined]
 [172] map
     @ ./abstractarray.jl:2294 [inlined]
 [173] assemble_events!(metamodels::Vector{MLJScikitLearnInterface.SVMClassifier}, resampling_machine::Machine{Resampler{CV}, false}, verbosity::Int64, tuning::Grid, history::Nothing, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, acceleration::CPU1{Nothing})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:427
 [174] build!(history::Nothing, n::Int64, tuning::Grid, model::MLJScikitLearnInterface.SVMClassifier, model_buffer::Channel{Any}, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, verbosity::Int64, acceleration::CPU1{Nothing}, resampling_machine::Machine{Resampler{CV}, false})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:620
 [175] fit(::MLJTuning.DeterministicTunedModel{Grid, MLJScikitLearnInterface.SVMClassifier}, ::Int64, ::DataFrame, ::CategoricalVector{Int64, UInt32, Int64, CategoricalValue{Int64, UInt32}, Union{}})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:699
 [176] fit_only!(mach::Machine{MLJTuning.DeterministicTunedModel{Grid, MLJScikitLearnInterface.SVMClassifier}, true}; rows::Vector{Int64}, verbosity::Int64, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:531
 [177] #fit!#103
     @ ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:598 [inlined]

Output of CategoricalArray.levels(y_svm):

julia> CategoricalArray.levels(y_svm)
ERROR: type UnionAll has no field levels
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base ./Base.jl:28
 [2] top-level scope
   @ REPL[82]:1

Inside the expandable section, can you put three backticks before and after the stack trace, to improve readability?

I had a typo.

It’s CategoricalArrays.levels. Try doing that.

I created y_svm as follows:

y_svm = @. ifelse(y == "Responder", 1, -1)
y_svm = categorical(y_svm)

Output of CategoricalArrays.levels:

image

I tried your suggestion:

y_svm = @. ifelse(y == "Responder", 1, 0)
y_svm = categorical(y_svm; levels=[0,1])

y_new = CategoricalArrays.CategoricalArray(convert(Vector{Bool}, y_svm))

The same error persists. Just to note, if I train other models such as random forests, ada boost, XGboost, etc. using the same X and y_svm they work totally fine. I am only getting the error when fitting SVMClassifier.

@ablaom Any idea what’s going on here?

@Rahul Thanks for reporting.

After ensuring that your target y_new is categorical, are you sure you are getting the exactly the same error - or maybe a different one?

Are you able to reproduce with some data you can share? What if you use

X, y_svm = make_blobs()

?

1 Like

Also, does the error persist if you use the LIBSVM.jl version of the model:

SVMClassifier = @load SVC pkg=LIBSVM
1 Like

I’m not able to reproduce your error with make_blobs data set. The following works fine for me:

using Pkg
Pkg.activate(temp=true)
Pkg.add("MLJ")
Pkg.add("MLJScikitLearnInterface")

using MLJ

SVMClassifier = @load SVMClassifier pkg=ScikitLearn
svm_model = SVMClassifier()

r_svm = range(svm_model, :C, values=[0.25, 0.5, 1])
self_tuning_svm = TunedModel(model=svm_model,
                             resampling=CV(nfolds=10),
                             repeats=5,
                             tuning=Grid(),
                             range=r_svm,
                             measure=accuracy)

X, y_svm = make_blobs();

svm = machine(self_tuning_svm, X, y_svm)
MLJ.fit!(svm)
predict(svm, selectrows(X, 1:2))

So I expect some issue with the data. Can you please report the output of schema(X) and scitype(y_svm) (or y_new)?

1 Like

@ablaom - I tried your code with the make_blobs() and ScikitLearn’s SVM and am getting the same error as before:

Error
┌ Error: Problem fitting the machine Machine{Resampler{CV},…}. 
└ @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:533
[ Info: Running type checks... 
[ Info: Type checks okay. 
┌ Error: Problem fitting the machine Machine{DeterministicTunedModel{Grid,…},…}. 
└ @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:533
[ Info: Running type checks... 
[ Info: Type checks okay. 
ERROR: LoadError: TypeError: in CategoricalValue, in T, expected T<:Union{AbstractChar, AbstractString, Number}, got Type{Any}
Stacktrace:
   [1] argtypes_to_type
     @ ./compiler/typeutils.jl:50 [inlined]
   [2] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1032
   [3] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
   [4] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
   [5] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
   [6] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
   [7] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
   [8] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
   [9] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [10] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [11] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [12] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [13] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
--- the last 11 lines are repeated 1 more time ---
  [25] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [26] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [27] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [28] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [29] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [30] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [31] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [32] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [33] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [34] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [35] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
  [36] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [37] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [38] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [39] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [40] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [41] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [42] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [43] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [44] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [45] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Nothing, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [46] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Nothing, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [47] abstract_apply(interp::Core.Compiler.NativeInterpreter, itft::Any, aft::Any, aargtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:738
  [48] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:952
  [49] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [50] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [51] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [52] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [53] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [54] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [55] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [56] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [57] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [58] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [59] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [60] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [61] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [62] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [63] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [64] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [65] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [66] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [67] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [68] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [69] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [70] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
  [71] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [72] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [73] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [74] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
  [75] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
  [76] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
  [77] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
  [78] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
  [79] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
  [80] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
  [81] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
--- the last 11 lines are repeated 1 more time ---
  [93] abstract_apply(interp::Core.Compiler.NativeInterpreter, itft::Any, aft::Any, aargtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:738
  [94] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:952
  [95] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
  [96] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
  [97] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
  [98] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
  [99] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [100] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [101] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [102] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [103] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [104] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [105] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
--- the last 11 lines are repeated 1 more time ---
 [117] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
 [118] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [119] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [120] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
 [121] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [122] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [123] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [124] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [125] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [126] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [127] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1054
 [128] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [129] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [130] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1462
 [131] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [132] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [133] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [134] typeinf_edge(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector, caller::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:806
 [135] abstract_call_method(interp::Core.Compiler.NativeInterpreter, method::Method, sig::Any, sparams::Core.SimpleVector, hardlimit::Bool, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:490
 [136] abstract_call_gf_by_type(interp::Core.Compiler.NativeInterpreter, f::Any, argtypes::Vector{Any}, atype::Any, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:143
 [137] abstract_call_known(interp::Core.Compiler.NativeInterpreter, f::Any, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1033
 [138] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState, max_methods::Int64)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1056
 [139] abstract_call(interp::Core.Compiler.NativeInterpreter, fargs::Vector{Any}, argtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1040
 [140] abstract_eval_statement(interp::Core.Compiler.NativeInterpreter, e::Any, vtypes::Vector{Any}, sv::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1167
 [141] typeinf_local(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1447
 [142] typeinf_nocycle(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/abstractinterpretation.jl:1520
 [143] _typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:214
 [144] typeinf(interp::Core.Compiler.NativeInterpreter, frame::Core.Compiler.InferenceState)
     @ Core.Compiler ./compiler/typeinfer.jl:209
 [145] typeinf
     @ ./compiler/typeinfer.jl:8 [inlined]
 [146] typeinf_type(interp::Core.Compiler.NativeInterpreter, method::Method, atypes::Any, sparams::Core.SimpleVector)
     @ Core.Compiler ./compiler/typeinfer.jl:914
 [147] return_type(interp::Core.Compiler.NativeInterpreter, f::Any, t::Any)
     @ Core.Compiler ./compiler/typeinfer.jl:963
 [148] return_type(f::Any, t::Any, world::UInt64)
     @ Core.Compiler ./compiler/typeinfer.jl:950
 [149] return_type(f::Any, t::Any)
     @ Core.Compiler ./compiler/typeinfer.jl:947
 [150] macro expansion
     @ ./array.jl:652 [inlined]
 [151] dict_with_eltype(DT_apply::F, kv::Base.Generator, t::Any) where F
     @ Base ./abstractdict.jl:541
 [152] Dict(kv::Any)
     @ Base ./dict.jl:129
 [153] (::MLJBase.var"#fit_and_extract_on_fold#299")(mach::Any, k::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1086
 [154] (::MLJBase.var"#276#277")(k::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:927
 [155] mapreduce_impl(f::Any, op::Any, A::Union{Base.AbstractBroadcasted, AbstractArray}, ifirst::Integer, ilast::Integer, blksize::Int64)
     @ Base ./reduce.jl:242
 [156] mapreduce_impl(f::Function, op::Function, A::UnitRange{Int64}, ifirst::Int64, ilast::Int64)
     @ Base ./reduce.jl:257
 [157] _mapreduce(f::Any, op::Any, #unused#::IndexLinear, A::Union{Base.AbstractBroadcasted, AbstractArray})
     @ Base ./reduce.jl:415
 [158] _mapreduce_dim(f::Function, op::Function, #unused#::Base._InitialValue, A::UnitRange{Int64}, #unused#::Colon)
     @ Base ./reducedim.jl:318
 [159] #mapreduce#672
     @ ./reducedim.jl:310 [inlined]
 [160] mapreduce(f::Function, op::Function, A::UnitRange{Int64})
     @ Base ./reducedim.jl:310
 [161] _evaluate!(func::Any, mach::Any, #unused#::CPU1, nfolds::Any, verbosity::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:926
 [162] evaluate!(mach::Machine{MLJScikitLearnInterface.SVMClassifier, true}, resampling::Vector{Tuple{Vector{Int64}, UnitRange{Int64}}}, weights::Nothing, class_weights::Nothing, rows::Nothing, verbosity::Int64, repeats::Int64, measures::Vector{Accuracy}, operations::Vector{typeof(predict)}, acceleration::CPU1{Nothing}, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1121
 [163] evaluate!(::Machine{MLJScikitLearnInterface.SVMClassifier, true}, ::CV, ::Nothing, ::Nothing, ::Nothing, ::Int64, ::Int64, ::Vector{Accuracy}, ::Vector{typeof(predict)}, ::CPU1{Nothing}, ::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1188
 [164] fit(::Resampler{CV}, ::Int64, ::Tables.MatrixTable{Matrix{Float64}}, ::CategoricalVector{Int64, UInt32, Int64, CategoricalValue{Int64, UInt32}, Union{}})
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1332
 [165] fit_only!(mach::Machine{Resampler{CV}, false}; rows::Nothing, verbosity::Int64, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:531
 [166] #fit!#103
     @ ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:598 [inlined]
 [167] event!(metamodel::MLJScikitLearnInterface.SVMClassifier, resampling_machine::Machine{Resampler{CV}, false}, verbosity::Int64, tuning::Grid, history::Nothing, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:390
 [168] #35
     @ ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:428 [inlined]
 [169] iterate
     @ ./generator.jl:47 [inlined]
 [170] _collect(c::Vector{MLJScikitLearnInterface.SVMClassifier}, itr::Base.Generator{Vector{MLJScikitLearnInterface.SVMClassifier}, MLJTuning.var"#35#36"{Machine{Resampler{CV}, false}, Int64, Grid, Nothing, NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, ProgressMeter.Progress}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
     @ Base ./array.jl:691
 [171] collect_similar
     @ ./array.jl:606 [inlined]
 [172] map
     @ ./abstractarray.jl:2294 [inlined]
 [173] assemble_events!(metamodels::Vector{MLJScikitLearnInterface.SVMClassifier}, resampling_machine::Machine{Resampler{CV}, false}, verbosity::Int64, tuning::Grid, history::Nothing, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, acceleration::CPU1{Nothing})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:427
 [174] build!(history::Nothing, n::Int64, tuning::Grid, model::MLJScikitLearnInterface.SVMClassifier, model_buffer::Channel{Any}, state::NamedTuple{(:models, :fields, :parameter_scales, :models_delivered), Tuple{Vector{MLJScikitLearnInterface.SVMClassifier}, Vector{Symbol}, Vector{Symbol}, Bool}}, verbosity::Int64, acceleration::CPU1{Nothing}, resampling_machine::Machine{Resampler{CV}, false})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:620
 [175] fit(::MLJTuning.DeterministicTunedModel{Grid, MLJScikitLearnInterface.SVMClassifier}, ::Int64, ::Tables.MatrixTable{Matrix{Float64}}, ::CategoricalVector{Int64, UInt32, Int64, CategoricalValue{Int64, UInt32}, Union{}})
     @ MLJTuning ~/.julia/packages/MLJTuning/bjRHJ/src/tuned_models.jl:699
 [176] fit_only!(mach::Machine{MLJTuning.DeterministicTunedModel{Grid, MLJScikitLearnInterface.SVMClassifier}, true}; rows::Nothing, verbosity::Int64, force::Bool)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:531
 [177] fit_only!
     @ ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:484 [inlined]
 [178] #fit!#103
     @ ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:598 [inlined]
 [179] fit!(mach::Machine{MLJTuning.DeterministicTunedModel{Grid, MLJScikitLearnInterface.SVMClassifier}, true})
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/machines.jl:596
Code
SVMClassifier = @load SVMClassifier pkg=ScikitLearn
svm_model = SVMClassifier()

r_svm = range(svm_model, :C, values=[0.25, 0.5, 1])
self_tuning_svm = TunedModel(model=svm_model,
                             resampling=CV(nfolds=10),
                             repeats=5,
                             tuning=Grid(),
                             range=r_svm,
                             measure=accuracy)

X, y_svm = make_blobs();

svm = machine(self_tuning_svm, X, y_svm)
MLJ.fit!(svm)

SVM fitting works fine with LIBSVM. Code is as follows:

SVMClassifier = @load SVC pkg=LIBSVM
svm_model = SVMClassifier()

r_svm = range(svm_model, :cost, values=[0.25, 0.5, 1])
self_tuning_svm = TunedModel(model=svm_model,
                             resampling=CV(nfolds=10),
                             repeats=5,
                             tuning=Grid(),
                             range=r_svm,
                             measure=accuracy)

X, y_svm = make_blobs();

svm = machine(self_tuning_svm, X, y_svm)
MLJ.fit!(svm)

I tried your code with the make_blobs() and ScikitLearn 's SVM and am getting the same error as before.

Then I presume you are not running the same package versions. Please report the outputs of using Pkg; Pkg.status() and versioninfo().

Here you go:

packages version info:

julia> import Pkg; Pkg.status()
      Status `~/.julia/environments/v1.6/Project.toml`
  [cbdf2221] AlgebraOfGraphics v0.5.4
  [024491cd] BetaML v0.5.5
  [336ed68f] CSV v0.9.4
  [13f3f980] CairoMakie v0.6.5
  [324d7699] CategoricalArrays v0.10.2
  [8be319e6] Chain v0.4.8
  [aaaa29a8] Clustering v0.14.2
  [a93c6f00] DataFrames v1.2.2
  [1313f7d8] DataFramesMeta v0.9.1
  [7806a523] DecisionTree v0.10.11
  [31c24e10] Distributions v0.25.16
  [aaaaaaaa] DynamicAxisWarping v0.4.9
  [f6006082] EvoTrees v0.8.5
  [587475ba] Flux v0.12.7
  [c91e804a] Gadfly v1.3.4
  [f7bf1975] Impute v0.6.7
  [b1bec4e5] LIBSVM v0.6.0
  [add582a8] MLJ v0.16.11
  [c6f25543] MLJDecisionTreeInterface v0.1.3
  [61c7150f] MLJLIBSVMInterface v0.1.4
  [d491faf4] MLJModels v0.14.12
  [5ae90465] MLJScikitLearnInterface v0.1.10
  [54119dfa] MLJXGBoostInterface v0.1.5
  [8162dcfd] PrettyPrint v0.2.0
  [d330b81b] PyPlot v2.10.0
  [ce6b1742] RDatasets v0.7.6
  [8523bd24] ShapML v0.3.1
  [84d833dd] TransformVariables v0.4.1
  [44d3d7a6] Weave v0.10.10
  [009559a3] XGBoost v1.1.1
  [10745b16] Statistics

Julia version info:

julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

Mmm. No clues there. My julia version is 1.6.3 but I doubt that’s the issue.

Can you report the full Manifest please with using Pkg; Pkg.status(mode=PKGMODE_MANIFEST)

Can you also please confirm that the error goes away if you use a bare pkg environment? Just use the code I included before to generate one (in a new julia session). Here it is again:

using Pkg
Pkg.activate(temp=true)
Pkg.add("MLJ")
Pkg.add("MLJScikitLearnInterface")

All of this with the make_blobs() data, thanks.

Just FYI. Both ScikitLearn.jl and LIBSVM.jl are essentially wrapping the same C-libraries. The latter is more direct as it avoids python altogether. (Perhaps the source of our issue is that we are calling python libraries with different versions??)

The result of using Pkg; Pkg.status(mode=PKGMODE_MANIFEST)

Status `~/.julia/environments/v1.6/Manifest.toml`
  [da404889] ARFFFiles v1.4.0
  [621f4979] AbstractFFTs v1.0.1
  [1520ce14] AbstractTrees v0.3.4
  [79e6a3ab] Adapt v3.3.1
  [cbdf2221] AlgebraOfGraphics v0.5.4
  [27a7e980] Animations v0.4.1
  [dce04be8] ArgCheck v2.1.0
  [4fba245c] ArrayInterface v3.1.32
  [67c07d97] Automa v0.8.2
  [13072b0f] AxisAlgorithms v1.0.0
  [ab4f0b2a] BFloat16s v0.2.0
  [fbb218c0] BSON v0.3.4
  [024491cd] BetaML v0.5.5
  [9e28174c] BinDeps v1.0.2
  [b99e7846] BinaryProvider v0.5.10
  [62783981] BitTwiddlingConvenienceFunctions v0.1.1
  [fa961155] CEnum v0.4.1
  [2a0fbf3d] CPUSummary v0.1.6
  [336ed68f] CSV v0.9.4
  [052768ef] CUDA v3.5.0
  [159f3aea] Cairo v1.0.5
  [13f3f980] CairoMakie v0.6.5
  [324d7699] CategoricalArrays v0.10.2
  [8be319e6] Chain v0.4.8
  [082447d4] ChainRules v1.11.6
  [d360d2e6] ChainRulesCore v1.5.0
  [fb6a15b2] CloseOpenIntervals v0.1.3
  [aaaa29a8] Clustering v0.14.2
  [944b1d66] CodecZlib v0.7.0
  [a2cac450] ColorBrewer v0.4.0
  [35d6a980] ColorSchemes v3.14.0
  [3da002f7] ColorTypes v0.11.0
  [c3611d14] ColorVectorSpace v0.9.7
  [5ae59095] Colors v0.12.8
  [861a8166] Combinatorics v1.0.2
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v3.35.0
  [a81c6b42] Compose v0.9.2
  [ed09eef8] ComputationalResources v0.3.2
  [8f4d0f93] Conda v1.5.2
  [d38c429a] Contour v0.5.7
  [7ad07ef1] CoupledFields v0.2.0
  [587fd27a] CovarianceEstimation v0.2.6
  [a8cc5b0e] Crayons v4.0.4
  [717857b8] DSP v0.7.3
  [9a962f9c] DataAPI v1.8.0
  [124859b0] DataDeps v0.7.7
  [a93c6f00] DataFrames v1.2.2
  [1313f7d8] DataFramesMeta v0.9.1
  [864edb3b] DataStructures v0.18.10
  [e2d170a0] DataValueInterfaces v1.0.0
  [7806a523] DecisionTree v0.10.11
  [163ba53b] DiffResults v1.0.3
  [b552c78f] DiffRules v1.3.1
  [b4f34e82] Distances v0.10.4
  [31c24e10] Distributions v0.25.16
  [ffbed154] DocStringExtensions v0.8.5
  [aaaaaaaa] DynamicAxisWarping v0.4.9
  [792122b4] EarlyStopping v0.1.9
  [da5c29d0] EllipsisNotation v1.1.0
  [f6006082] EvoTrees v0.8.5
  [e2ba6199] ExprTools v0.1.6
  [c87230d0] FFMPEG v0.4.1
  [7a1cc6ca] FFTW v1.4.5
  [5789e2e9] FileIO v1.11.1
  [48062228] FilePathsBase v0.9.11
  [1a297f60] FillArrays v0.12.4
  [53c48c17] FixedPointNumbers v0.8.4
  [587475ba] Flux v0.12.7
  [9dda63f9] ForceImport v0.0.3
  [59287772] Formatting v0.4.2
  [f6369f11] ForwardDiff v0.10.19
  [b38be410] FreeType v4.0.0
  [663a7486] FreeTypeAbstraction v0.9.2
  [d9f16b24] Functors v0.2.7
  [38e38edf] GLM v1.5.1
  [0c68f7d7] GPUArrays v8.1.2
  [61eb1bfa] GPUCompiler v0.13.6
  [28b8d3ca] GR v0.62.1
  [c91e804a] Gadfly v1.3.4
  [cf35fbd7] GeoInterface v0.5.5
  [5c1252a2] GeometryBasics v0.4.1
  [a2bd30eb] Graphics v1.1.0
  [3955a311] GridLayoutBase v0.6.1
  [42e2da0e] Grisu v1.0.2
  [cd3eb016] HTTP v0.9.16
  [a1b4810d] Hexagons v0.2.0
  [eafb193a] Highlights v0.4.5
  [3e5b6fbb] HostCPUFeatures v0.1.5
  [0e44f5e4] Hwloc v2.0.0
  [7073ff75] IJulia v1.23.2
  [7869d1d1] IRTools v0.4.3
  [615f187c] IfElse v0.1.0
  [a09fc81d] ImageCore v0.9.2
  [82e4d734] ImageIO v0.5.8
  [f7bf1975] Impute v0.6.7
  [9b13fd28] IndirectArrays v1.0.0
  [d25df0c9] Inflate v0.1.2
  [83e8ac13] IniFile v0.5.0
  [842dd82b] InlineStrings v1.0.1
  [a98d9a8b] Interpolations v0.13.4
  [8197267c] IntervalSets v0.5.3
  [d8418881] Intervals v1.5.0
  [41ab1584] InvertedIndices v1.1.0
  [92d709cd] IrrationalConstants v0.1.0
  [f1662d9f] Isoband v0.1.1
  [c8e1da08] IterTools v1.3.0
  [b3c1a2ee] IterationControl v0.4.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.3.0
  [9da8a3cd] JLSO v2.6.0
  [682c06a0] JSON v0.21.2
  [e5e0dc1b] Juno v0.8.4
  [5ab0869b] KernelDensity v0.6.3
  [2d691ee1] LIBLINEAR v0.6.0
  [b1bec4e5] LIBSVM v0.6.0
  [929cbde3] LLVM v4.6.0
  [b964fa9f] LaTeXStrings v1.2.1
  [23fbe1c1] Latexify v0.15.9
  [a5e1c1ea] LatinHypercubeSampling v1.8.0
  [10f19ff3] LayoutPointers v0.1.4
  [7f8f8fb0] LearnBase v0.4.1
  [7acf609c] LightGBM v0.5.2
  [4345ca2d] Loess v0.5.3
  [2ab3a3ac] LogExpFunctions v0.3.3
  [bdcacae8] LoopVectorization v0.12.94
  [30fc2ffe] LossFunctions v0.7.2
  [add582a8] MLJ v0.16.11
  [a7f614a8] MLJBase v0.18.24
  [c6f25543] MLJDecisionTreeInterface v0.1.3
  [50ed68f4] MLJEnsembles v0.1.2
  [614be32b] MLJIteration v0.3.3
  [61c7150f] MLJLIBSVMInterface v0.1.4
  [e80e1ace] MLJModelInterface v1.3.3
  [d491faf4] MLJModels v0.14.12
  [5ae90465] MLJScikitLearnInterface v0.1.10
  [17bed46d] MLJSerialization v1.1.2
  [03970b2e] MLJTuning v0.6.14
  [54119dfa] MLJXGBoostInterface v0.1.5
  [1914dd2f] MacroTools v0.5.7
  [ee78f7c6] Makie v0.15.2
  [20f20a25] MakieCore v0.1.3
  [d125e4d3] ManualMemory v0.1.6
  [dbb5928d] MappedArrays v0.4.1
  [7eb4fadd] Match v1.1.0
  [0a4f8689] MathTeXEngine v0.2.0
  [739be429] MbedTLS v1.0.3
  [442fdcdd] Measures v0.3.1
  [e89f7d12] Media v0.5.0
  [f28f55f0] Memento v1.2.0
  [e1d29d7a] Missings v1.0.1
  [78c3b35d] Mocking v0.7.3
  [e94cdb99] MosaicViews v0.3.3
  [ffc61752] Mustache v1.0.12
  [d8a4904e] MutableArithmetics v0.2.22
  [872c559c] NNlib v0.7.29
  [a00861dc] NNlibCUDA v0.1.9
  [77ba4419] NaNMath v0.3.5
  [356022a1] NamedDims v0.2.41
  [b8a86587] NearestNeighbors v0.4.9
  [f09324ee] Netpbm v1.0.2
  [46757867] NetworkLayout v0.4.3
  [510215fc] Observables v0.4.0
  [6fe1bfb0] OffsetArrays v1.10.7
  [52e1d378] OpenEXR v0.3.2
  [8b6db2d4] OpenML v0.1.1
  [bac558e1] OrderedCollections v1.4.1
  [90014a1f] PDMats v0.11.1
  [f57f5aa1] PNGFiles v0.3.9
  [19eb6ba3] Packing v0.4.2
  [5432bcbf] PaddedViews v0.5.10
  [d96e819e] Parameters v0.12.3
  [69de0a69] Parsers v2.0.3
  [eebad327] PkgVersion v0.1.1
  [ccf2f8ad] PlotThemes v2.0.1
  [995b91a9] PlotUtils v1.0.14
  [91a5bcdd] Plots v1.23.5
  [1d0040c9] PolyesterWeave v0.1.2
  [647866c9] PolygonOps v0.1.1
  [f27b6e38] Polynomials v2.0.17
  [2dfb63ee] PooledArrays v1.3.0
  [21216c6a] Preferences v1.2.2
  [8162dcfd] PrettyPrint v0.2.0
  [08abe8d2] PrettyTables v1.1.0
  [92933f4c] ProgressMeter v1.7.1
  [438e738f] PyCall v1.92.5
  [d330b81b] PyPlot v2.10.0
  [1fd47b50] QuadGK v2.4.2
  [df47a6cb] RData v0.8.3
  [ce6b1742] RDatasets v0.7.6
  [74087812] Random123 v1.4.2
  [e6cf234a] RandomNumbers v1.5.3
  [c84ed2f1] Ratios v0.4.2
  [3cdcf5f2] RecipesBase v1.1.2
  [01d81517] RecipesPipeline v0.4.1
  [189a3867] Reexport v1.2.2
  [05181044] RelocatableFolders v0.1.0
  [ae029012] Requires v1.1.3
  [79098fc4] Rmath v0.7.0
  [fdea26ae] SIMD v3.3.1
  [3cdde19b] SIMDDualNumbers v0.1.0
  [94e857df] SIMDTypes v0.1.0
  [476501e8] SLEEFPirates v0.6.28
  [7b38b023] ScanByte v0.3.0
  [321657f4] ScientificTypes v2.3.3
  [30f210dd] ScientificTypesBase v2.3.0
  [3646fa90] ScikitLearn v0.6.4
  [6e75b9c4] ScikitLearnBase v0.5.0
  [6c6a2e73] Scratch v1.1.0
  [91c51154] SentinelArrays v1.3.7
  [8523bd24] ShapML v0.3.1
  [1277b4bf] ShiftedArrays v1.0.0
  [992d4aef] Showoff v1.0.3
  [73760f76] SignedDistanceFields v0.4.0
  [25b0cc0c] SlidingDistancesBase v0.3.2
  [b85f4697] SoftGlobalScope v1.1.0
  [a2af1166] SortingAlgorithms v1.0.1
  [276daf66] SpecialFunctions v1.6.1
  [860ef19b] StableRNGs v1.0.0
  [cae243ae] StackViews v0.1.1
  [aedffcd0] Static v0.3.3
  [90137ffa] StaticArrays v1.2.12
  [64bff920] StatisticalTraits v2.1.0
  [82ae8749] StatsAPI v1.0.0
  [2913bbd2] StatsBase v0.33.10
  [4c63d2b9] StatsFuns v0.9.10
  [3eaba693] StatsModels v0.6.26
  [69024149] StringEncodings v0.3.5
  [09ab397b] StructArrays v0.6.3
  [cea106d9] Syslogs v0.3.0
  [ab02a1b2] TableOperations v1.2.0
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.5.1
  [62fd8b95] TensorCore v0.1.1
  [8290d209] ThreadingUtilities v0.4.6
  [731e570b] TiffImages v0.4.2
  [f269a46b] TimeZones v1.6.2
  [a759f4b9] TimerOutputs v0.5.13
  [3bb67fe8] TranscodingStreams v0.9.6
  [84d833dd] TransformVariables v0.4.1
  [30578b45] URIParser v0.4.1
  [5c2747f8] URIs v1.3.0
  [3a884ed6] UnPack v1.0.2
  [1cfade01] UnicodeFun v0.4.1
  [3d5dd08c] VectorizationBase v0.21.21
  [81def892] VersionParsing v1.2.1
  [ea10d353] WeakRefStrings v1.3.0
  [44d3d7a6] Weave v0.10.10
  [efce3f68] WoodburyMatrices v0.5.3
  [009559a3] XGBoost v1.1.1
  [ddb6d928] YAML v0.4.7
  [c2297ded] ZMQ v1.2.1
  [a5390f91] ZipFile v0.9.4
  [e88e6eb3] Zygote v0.6.21
  [700de1a5] ZygoteRules v0.2.2
  [6e34b625] Bzip2_jll v1.0.8+0
  [83423d85] Cairo_jll v1.16.1+0
  [5ae413db] EarCut_jll v2.2.3+0
  [2e619515] Expat_jll v2.2.10+0
  [b22a6f82] FFMPEG_jll v4.4.0+0
  [f5851436] FFTW_jll v3.3.10+0
  [a3f928ae] Fontconfig_jll v2.13.93+0
  [d7e528f0] FreeType2_jll v2.10.4+0
  [559328eb] FriBidi_jll v1.0.10+0
  [0656b61e] GLFW_jll v3.3.5+1
  [d2c73de3] GR_jll v0.62.0+0
  [78b55507] Gettext_jll v0.21.0+0
  [7746bdde] Glib_jll v2.68.3+0
  [3b182d85] Graphite2_jll v1.3.14+0
  [2e76f6c2] HarfBuzz_jll v2.8.1+0
  [e33a78d0] Hwloc_jll v2.5.0+0
  [905a6f67] Imath_jll v3.1.2+0
  [1d5cc7b8] IntelOpenMP_jll v2018.0.3+2
  [aacddb02] JpegTurbo_jll v2.1.0+0
  [c1c5ebd0] LAME_jll v3.100.1+0
  [dad2f222] LLVMExtra_jll v0.0.11+0
  [dd4b983a] LZO_jll v2.10.1+0
  [e9f186c6] Libffi_jll v3.2.2+1
  [d4300ac3] Libgcrypt_jll v1.8.7+0
  [7e76a0d4] Libglvnd_jll v1.3.0+3
  [7add5ba3] Libgpg_error_jll v1.42.0+0
  [94ce4f54] Libiconv_jll v1.16.1+1
  [4b2f31a3] Libmount_jll v2.35.0+0
  [89763e89] Libtiff_jll v4.3.0+0
  [38a345b3] Libuuid_jll v2.36.0+0
  [856f044c] MKL_jll v2021.1.1+2
  [e7412a2a] Ogg_jll v1.3.5+0
  [18a262bb] OpenEXR_jll v3.1.1+0
  [458c3c95] OpenSSL_jll v1.1.10+0
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [91d4177d] Opus_jll v1.3.2+0
  [2f80f16e] PCRE_jll v8.44.0+0
  [36c8627f] Pango_jll v1.47.0+0
  [30392449] Pixman_jll v0.40.1+0
  [ea2cea3b] Qt5Base_jll v5.15.3+0
  [f50d1b31] Rmath_jll v0.3.0+0
  [a2964d1f] Wayland_jll v1.19.0+0
  [2381bf8a] Wayland_protocols_jll v1.18.0+4
  [a5c6f535] XGBoost_jll v1.4.2+0
  [02c8fc9c] XML2_jll v2.9.12+0
  [aed1982a] XSLT_jll v1.1.34+0
  [4f6342f7] Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] Xorg_libXau_jll v1.0.9+4
  [935fb764] Xorg_libXcursor_jll v1.2.0+4
  [a3789734] Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] Xorg_libXext_jll v1.3.4+4
  [d091e8ba] Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] Xorg_libXi_jll v1.7.10+4
  [d1454406] Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] Xorg_libXrender_jll v0.9.10+4
  [14d82f49] Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] Xorg_libxcb_jll v1.13.0+3
  [cc61e674] Xorg_libxkbfile_jll v1.1.0+4
  [12413925] Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] Xorg_xcb_util_jll v0.4.0+1
  [975044d2] Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] Xorg_xtrans_jll v1.4.0+3
  [8f1865be] ZeroMQ_jll v4.3.4+0
  [3161d3a3] Zstd_jll v1.5.0+0
  [9a68df92] isoband_jll v0.2.2+0
  [0ac62f75] libass_jll v0.15.1+0
  [f638f0a6] libfdk_aac_jll v2.0.2+0
  [275f1f90] liblinear_jll v2.30.0+0
  [b53b4c65] libpng_jll v1.6.38+0
  [a9144af2] libsodium_jll v1.0.20+0
  [08558c22] libsvm_jll v3.24.0+1
  [f27f6e37] libvorbis_jll v1.3.7+0
  [1270edf5] x264_jll v2021.5.5+0
  [dfaa095f] x265_jll v3.5.0+0
  [d8fb68d0] xkbcommon_jll v0.9.1+5
  [0dad84c5] ArgTools
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [f43a241f] Downloads
  [7b1f6079] FileWatching
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [4af54fe1] LazyArtifacts
  [b27032c2] LibCURL
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions
  [44cfe95a] Pkg
  [de0858da] Printf
  [9abbd945] Profile
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML
  [a4e569a6] Tar
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll
  [deac9b47] LibCURL_jll
  [29816b5a] LibSSH2_jll
  [c8ffd9c3] MbedTLS_jll
  [14a3606d] MozillaCACerts_jll
  [83775a58] Zlib_jll
  [8e850ede] nghttp2_jll
  [3f19e933] p7zip_jll

Also when I did the following, the code ran successfully:

using Pkg
Pkg.activate(temp=true)
Pkg.add("MLJ")
Pkg.add("MLJScikitLearnInterface")

using MLJ

SVMClassifier = @load SVMClassifier pkg=ScikitLearn
svm_model = SVMClassifier()

r_svm = range(svm_model, :C, values=[0.25, 0.5, 1])
self_tuning_svm = TunedModel(model=svm_model,
                             resampling=CV(nfolds=10),
                             repeats=5,
                             tuning=Grid(),
                             range=r_svm,
                             measure=accuracy)

X, y_svm = make_blobs();

svm = machine(self_tuning_svm, X, y_svm)
MLJ.fit!(svm)

Right, thanks for that.

Unfortunately, I can instantiate a package environment with the same versions listed in your Project but am still unable reproduce your error (on julia 1.6.3) :cry:

Can you please zip your Project.toml and Manifest.toml files and post here? I will try reproducing your Manifest.toml exactly and see if that makes a difference.

Let me know if you need help locating the right ones.

Yes, could you please let me know how to locate those files?

The path is given above:

Status `~/.julia/environments/v1.6/Manifest.toml`

Thank you @nilshg .
@ablaom I cannot attach zip files here, so I uploaded the .toml files to google drive and attaching the link here.

Thanks @Rahul. Unfortunately I am still unable to reproduce your error, even with same manifest.

For the record, here again is what is working for me:

using MLJ

SVMClassifier = @load SVMClassifier pkg=ScikitLearn
svm_model = SVMClassifier()

r_svm = range(svm_model, :C, values=[0.25, 0.5, 1])
self_tuning_svm = TunedModel(model=svm_model,
                             resampling=CV(nfolds=10),
                             repeats=5,
                             tuning=Grid(),
                             range=r_svm,
                             measure=accuracy)

X, y_svm = make_blobs();

svm = machine(self_tuning_svm, X, y_svm)
MLJ.fit!(svm)
predict(svm, selectrows(X, 1:2))
julia> versioninfo()
Julia Version 1.6.3
Commit ae8452a9e0 (2021-09-23 17:34 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_LTS_PATH = /Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia
  JULIA_PATH = /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
  JULIA_EGLOT_PATH = /Applications/Julia-1.5.app/Contents/Resources/julia/bin/julia
  JULIA_NUM_THREADS = 5
  JULIA_NIGHTLY_PATH = /Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia

To be honest, I’m stumped. The only thing I can think of is that ScikitLearn.jl is calling different python libraries which may also mean we are using different versions of the LIBSVM library written in C which both MLJ SVC interfaces are ultimately calling. Sorry, but I’m not so knowledgeable about diagnosing this kind of issue. Perhaps one of these people can help: @stevengj @tkf @giordano @samuel_okon

At least you have a workaround: use the LIBSVM.jl version of the model.

2 Likes

Looking at the error message in the early comment SVM Errors With Grid Search - #15 by Rahul the error is from the type inference

ERROR: LoadError: TypeError: in CategoricalValue, in T, expected T<:Union{AbstractChar, AbstractString, Number}, got Type{Any}
Stacktrace:
   [1] argtypes_to_type
     @ ./compiler/typeutils.jl:50 [inlined]

(i.e., from here: https://github.com/JuliaLang/julia/blob/v1.6.4/base/compiler/typeutils.jl#L50)

which is invoked via Compiler.return_type in the Dict constructor

 [149] return_type(f::Any, t::Any)
     @ Core.Compiler ./compiler/typeinfer.jl:947
 [150] macro expansion
     @ ./array.jl:652 [inlined]
 [151] dict_with_eltype(DT_apply::F, kv::Base.Generator, t::Any) where F
     @ Base ./abstractdict.jl:541
 [152] Dict(kv::Any)
     @ Base ./dict.jl:129
 [153] (::MLJBase.var"#fit_and_extract_on_fold#299")(mach::Any, k::Any)
     @ MLJBase ~/.julia/packages/MLJBase/u6vLz/src/resampling.jl:1086

If someone can minimize the example to a single call Dict(kv) where kv is an appropriate collection of key-value pairs, I think it is worth filing an issue report to Julia. (cc @aviatesk @jameson)

1 Like