# MLJ - Error - Models support multitarget but measures do not?

**URL:** https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091
**Category:** Machine Learning
**Tags:** mlj
**Created:** [January 9, 2021, 6:04pm UTC](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091 "2021-01-09T18:04:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![diadora77](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diadora77/32/220469_2.png) [@diadora77](https://discourse.julialang.org/u/diadora77)
#### Post date: [January 9, 2021, 6:04pm UTC](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091/1 "2021-01-09T18:04:03Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![samuel\_okon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samuel_okon/32/10285_2.png) [@samuel\_okon](https://discourse.julialang.org/u/samuel_okon)
#### Post date: [January 10, 2021, 10:47am UTC](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091/2 "2021-01-10T10:47:10Z")

</div>

@diadora77. At the moment there aren’t any measures for multi-target classification implemented in MLJ but there are plans to add some.

---

<div class="post-metadata">

### Author: ![diadora77](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diadora77/32/220469_2.png) [@diadora77](https://discourse.julialang.org/u/diadora77)
#### Post date: [January 10, 2021, 1:50pm UTC](https://discourse.julialang.org/t/mlj-error-models-support-multitarget-but-measures-do-not/53091/3 "2021-01-10T13:50:22Z")

</div>

I’m more interested in why it seems MLJ supports multi-target **regression** models yet the available measures or metrics, in my example RootMeanSquaredError, do not support multi-targets. From my reading the docs, MLJ seems to support multi-target regression via wrapping other libraries such as ScikitLearn.jl but it doesn’t seem measures/metrics available in MLJ will work with the models. If this is truly the case then all multi-target **regression** models are really not supported. Again, I’m relatively new to MLJ so I’m concerned that I’m missing something. As an aside, I am able to treat each target independently but that gets unwieldy quick.
