# Question about MLJ

**URL:** <https://discourse.julialang.org/t/question-about-mlj/70458>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 27, 2021, 7:56am UTC](https://discourse.julialang.org/t/question-about-mlj/70458 "2021-10-27T07:56:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [October 27, 2021, 7:56am UTC](https://discourse.julialang.org/t/question-about-mlj/70458/1 "2021-10-27T07:56:52Z")

</div>

I want to make a multivariate probability prediction, and this is my current MLJ model search, but I don’t know if these models are valid. How can I find an efficient prediction model for my data?

```julia
task(model) = model.is_supervised && model.prediction_type == :probabilistic

models(task)  

```

47-element Vector{NamedTuple{(:name, :package\_name, :is\_supervised, :abstract\_type, :deep\_properties, :docstring, :fit\_data\_scitype, :hyperparameter\_ranges, :hyperparameter\_types, :hyperparameters, :implemented\_methods, :inverse\_transform\_scitype, :is\_pure\_julia,  
:is\_wrapper, :iteration\_parameter, :load\_path, :package\_license, :package\_url, :package\_uuid, :predict\_scitype, :prediction\_type, :supports\_class\_weights, :supports\_online, :supports\_training\_losses, :supports\_weights, :transform\_scitype, :input\_scitype, :target\_scitype, :output\_scitype), T} where T\<:Tuple}:  
(name = AdaBoostClassifier, package\_name = ScikitLearn, … )  
(name = AdaBoostStumpClassifier, package\_name = DecisionTree, … )  
(name = BaggingClassifier, package\_name = ScikitLearn, … )  
(name = BayesianLDA, package\_name = MultivariateStats, … )  
(name = BayesianLDA, package\_name = ScikitLearn, … )  
(name = BayesianQDA, package\_name = ScikitLearn, … )  
⋮  
(name = ProbabilisticSGDClassifier, package\_name = ScikitLearn, … )  
(name = RandomForestClassifier, package\_name = BetaML, … )  
(name = RandomForestClassifier, package\_name = DecisionTree, … )  
(name = RandomForestClassifier, package\_name = ScikitLearn, … )  
(name = SubspaceLDA, package\_name = MultivariateStats, … )  
(name = XGBoostClassifier, package\_name = XGBoost, … )

thanks！

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [October 27, 2021, 8:51am UTC](https://discourse.julialang.org/t/question-about-mlj/70458/2 "2021-10-27T08:51:56Z")

</div>

What do you mean by “valid”? Are you looking for methods that can be run on your data (this could be done with e.g. [`matching(model, X, y)`](https://alan-turing-institute.github.io/MLJ.jl/dev/model_search/#Matching-models-to-data))?

---

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [October 27, 2021, 9:11am UTC](https://discourse.julialang.org/t/question-about-mlj/70458/3 "2021-10-27T09:11:34Z")

</div>

What I want to say is that I want to use the method of neural network to predict my multivariate data. How can I choose the best model among these 47 models for prediction?

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [October 27, 2021, 11:30am UTC](https://discourse.julialang.org/t/question-about-mlj/70458/4 "2021-10-27T11:30:38Z")

</div>

> [@abcde](#):
>
> How can I choose the best model among these 47 models for prediction?

This is usually difficult to know in advance, because it depends on your data which model is the best one. I often pick a linear model as a first benchmark and if I happen to have enough data and guess that there is a non-linear relationship between the input and the output I would try a few non-linear methods, like neural networks, random forests, boosted trees or SVMs. To find the hyper-parameters and compare different kinds of models a common approach is based on cross-validation (see e.g. [here](https://alan-turing-institute.github.io/MLJ.jl/dev/tuning_models/) for how to tune models).

> [@abcde](#):
>
> I want to use the method of neural network to predict my multivariate data

Multilayer Neural Networks are supported by [`MLJFlux`](https://github.com/FluxML/MLJFlux.jl).

---

<div class="post-metadata">

**Author:** ![abcde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abcde/32/16180_2.png) [@abcde](https://discourse.julialang.org/u/abcde)\
**Post date:** [October 27, 2021, 12:35pm UTC](https://discourse.julialang.org/t/question-about-mlj/70458/5 "2021-10-27T12:35:47Z")

</div>

Do you know where there are code examples for this? Thank you very much!

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [October 27, 2021, 1:10pm UTC](https://discourse.julialang.org/t/question-about-mlj/70458/6 "2021-10-27T13:10:45Z")

</div>

There are for example these [tutorials](https://juliaai.github.io/DataScienceTutorials.jl/). I also use MLJ for a [course](https://bio322.epfl.ch) I am currently teaching (new material will be added every week until mid-december).

---

<div class="post-metadata">

**Author:** ![zuruck](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zuruck](https://discourse.julialang.org/u/zuruck)\
**Post date:** [October 27, 2021, 2:27pm UTC](https://discourse.julialang.org/t/question-about-mlj/70458/7 "2021-10-27T14:27:27Z")

</div>

Thank you for these links.
