a-hanf / mlr3automl

Automated machine learning in mlr3
GNU Lesser General Public License v3.0
25 stars 4 forks source link

Inspect results of training #30

Closed MislavSag closed 3 years ago

MislavSag commented 3 years ago

Thanks for great package. I planned to write a package with AutoML for finace (investing) using mlr3 but it seems on first the you have already made great package (better than I woud be able to do for sure :)).

I have tried the package on my dataset with only one learner and Inf runtime. Here is simple code:

bmr_results = AutoML(my_task, learner_list = c("classif.ranger"), runtime = Inf)
bmr_results$train()

I don't understand how can inspect results of the model after training? I can see following methods and attributes:

names(bmr_results)
 [1] ".__enclos_env__"   "custom_trafo"      "additional_params" "portfolio"         "tuner"             "runtime"           "tuning_terminator"
 [8] "measure"           "resampling"        "preprocessing"     "learner"           "learner_timeout"   "learner_list"      "task"             
[15] "clone"             "initialize"        "tuned_params"      "resample"          "predict"           "train"        

I can't see aggregate method. I have also tried to use resmaple method instead of train, but I got the same result. Additionally I would like to if it is possible to use feature select steps in preprocessing?

a-hanf commented 3 years ago

Hi and thanks for your comment :)

The model is saved in the $learner slot. It is an AutoTuner from mlr3tuning (link to docs) which wraps a GraphLearner from mlr3pipelines (link to docs). You can use the $tuned_params method to view the hyperparameters selected during training: model$tuned_params(). Let me know if there are any more questions around the methods and attributes.

For feature selection there are multiple options. One is to create a feature selection pipeline using mlr3pipelines and mlr3filters like in this example: link to docs. mlr3fselect could also be interesting for you (not sure it would be as easy to integrate into your mlr3automl pipeline).

MislavSag commented 3 years ago

Thanks. In meantime I realized there is an archive attribute inside learner and also figured out there is an tuned_params.

I have already implemented filters from mlr3filters , but can't figure out how to implement mlr3fselect inside graph (preprocessing). I have tried to find example in mlr3gallery but I have only found examples without pipelines. In the end I have decided to to feature selection outside of pipes (graph) and than use important features inside AutoML.