I am trying to use MLJ to train some data using the random forest classifier. In order to do that, I have coerce my categorical variables to Multiclass(scitype) and continuous features to Continuous. (I have also changed the target variables scitype to Multiclass)
MLJ.schema(X)
However when I construct the machine object I get the following warning,
mach = machine(forest, X,y)
┌ Warning: The scitype of `X`, in `machine(model, X, ...)` is incompatible
with `model=RandomForestClassifier @695`:
│ scitype(X) = Table{Union{AbstractArray{Continuous,1},
AbstractArray{Multiclass{8},1}, AbstractArray{Multiclass{3},1},
AbstractArray{Multiclass{14},1}, AbstractArray{Multiclass{7},1},
AbstractArray{Multiclass{12},1}}}
│ input_scitype(model) = Table{var"#s45"} where var"#s45"
<:Union{AbstractArray{var"#s13",1} where var"#s13"<:Count,
AbstractArray{var"#s13",1} where var"#s13"<:OrderedFactor,
AbstractArray{var"#s13",1} where var"#s13"<:Continuous}.
followed by this TaskFailedExceptionErrorwhen I fit the model
trainRows, testRows = partition(eachindex(y),0.7, shuffle = true)
MLJ.fit(mach, rows = trainRows)
I tested the model with just the Continuous features and it works fine. So it's something incorrect with categorical variables (with scitype Muticlass), but can't quite figure out what it is. Any ideas what I am doing incorrectly?
