Hi- I’m relatively new to MLJ but have decent knowledge and experience using ScikitLearn. MLJ looks promising with more flexibility in model creation. In testing it out for my research, I’m struggling to get a basic model setup and evaluated for multi-target regression. Primary problem seems to be any selected measure (rms, mae, etc) doesn’t accept multitarget even though the selected models do support. Below is a short, example problem of the issue I’m having. My assumption is that I’m missing something basic… Thanks for any suggestions.
#initialize data for testing
X_rand = rand(50,3)
coef = [1 0; 0 1; 1 1]
y_rand = X_rand*coef + rand(50,2)
convert to dataframe for MLJ inputs
X_rand_df = DataFrames.DataFrame(X_rand)
y_rand_df = DataFrames.DataFrame(y_rand)
#check which models are appropriate for multitarget test data
println(“Models that work with data:\n”)
for items in models(matching(X_rand_df, y_rand_df))
println(items)
end
number of models here, use ScikitLearn MultiTaskLassoRegressor
#check which measures are appropriate for target
println(“\nMeaures that work with data:\n”)
for items in measures(matching(y_rand_df))
println(items)
end
Here, there’s no output which is a flag to me
#make a model
lasso_model = @load MultiTaskLassoRegressor pkg=ScikitLearn
fit the model
MLJ.evaluate(lasso_model, X_rand_df, y_rand_df
, resampling = CV(shuffle=true)
, measure = rms#, check_measure=false
, verbosity = 0)
Here’s output showing failure of measurement and target type
ArgumentError:
scitype of target = Table{AbstractArray{Continuous,1}} but target_scitype(RootMeanSquaredError @209) = Union{AbstractArray{Continuous,1}, AbstractArray{Count,1}}.
To override measure checks, set check_measure=false.