Questions tagged [mlr3]

mlr3 is the next generation of the mlr package for machine learning in R.

mlr3 is a redesigned version of the mlr package for machine learning in R, embracing R6 and data.table for cleaner code and more efficient operations. It provides a common interface to many learners that are implemented in R and many additional things, such as hyperparameter tuning and machine learning pipelines, on top. More information at https://mlr3.mlr-org.com/

mlr3 is a collection of packages with minimal dependencies between them to make installation easier. The mlr3 ecosystem comprises

  • the core package mlr3 and mlr3misc for miscellaneous additional functionality
  • mlr3featsel for feature selection
  • mlr3pipelines for machine learning pipelines
  • mlr3tuning for hyperparameter tuning
  • mlr3learners and mlr3extralearners for additional learner interfaces
  • mlr3ordinal for ordinal regression
  • mlr3survival for survival analysis
  • mlr3cluster for cluster analysis
  • mlr3forecasting for forecasting
  • mlr3fda for functional data analysis
  • mlr3spatiotemporal for spatial and temporal analytics
  • mlr3keras for deep learning with Keras
  • mlr3viz for visualizations
258 questions
6
votes
0 answers

Variable importance by "mlr3filters" does not work in "mlr3proba" after preprocessing data with "mlr3pipelines"

Running the code below using mlr3proba and mlr3pipelines and mlr3filters packages of R to implement rpart algorithm on a preporcessed dataset and performing "variable importance", shows an error: task <- tsk("iris") learner <-…
user15779336
5
votes
1 answer

Define mlr3 task using data from a database (different tables)?

This is a newbie question. How do I define a (classification) tsk that uses data from a (sqlite) database? The mlr3db example seems to write data from memory first. In my case, the data is already in the database. What is maybe a bigger problem, the…
Karsten W.
  • 17,826
  • 11
  • 69
  • 103
5
votes
1 answer

MLR3 average scores from an ensemble

Using an example from the very helpful mlr3 book, I am trying to simply return the average score of the stacked model output. Can someone please explain how to do this using mlr3? I've tried using both LearnerClassifAvg$new( id = "classif.avg") and…
snowkeep
  • 107
  • 4
5
votes
1 answer

Using mlr3-pipelines to impute data and encode factor columns in GraphLearner?

I have a few questions regarding the use of mlr3-pipelines. Indeed, my goal is to create a pipeline that combines three 3 graphs: 1 - A graph to process categorical variables: level imputation => standardization imp_cat = po("imputenewlvl",…
ZchGarinch
  • 295
  • 3
  • 13
4
votes
1 answer

How to get the coefficient of the Logistic Regression in mlr3?

I have just started using mlr3 and still very unfamiliar with the syntax, I have two questions: How can I access the coefficient from the trained Logistic Regression in mlr3? I am dealing with a extremely imbalanced dataset, 98% vs 2%, and there…
Carl
  • 109
  • 8
4
votes
1 answer

Importance based variable reduction

I am facing a difficulty with filtering out the least important variables in my model. I received a set of data with more than 4,000 variables, and I have been asked to reduce the number of variables getting into the model. I did try already two…
Radbys
  • 400
  • 2
  • 10
4
votes
1 answer

nested branches (and dependencies) in mlr3

I'm trying to use information_gain and mrmr feature filtering, but also a combination of information_gain and mrmr feature filtering (the union of the two). I've tried creating a reprex below. library("mlr3verse") task <- tsk('sonar') filters =…
4
votes
1 answer

Tuning GLMNET using mlr3

MLR3 is really cool. I am trying to tune the regularisation prarameter searchspace_glmnet_trafo = ParamSet$new(list( ParamDbl$new("regr.glmnet.lambda", log(0.01), log(10)) )) searchspace_glmnet_trafo$trafo = function(x, param_set) { …
warsaga
  • 273
  • 2
  • 11
3
votes
2 answers

How to make Bayesian hyperparameter optimization reproducible using "mbo" tuner?

I would like to use R's mlr3* packages to build ML algos in a reproducible manner. I have tried to use regr.glmboost learner with mbo tuner and run_time terminator. I have played around with the HPO part but I have not been able to make it…
sanyi
  • 41
  • 1
  • 6
3
votes
0 answers

mlr3 Error: Cannot combine stratification with grouping

Code Example: # BLOCKING by "userID" task$col_roles$group = "userID" # Remove "userID" from features task$col_roles$feature = setdiff(task$col_roles$feature, "userID") # STRATIFICATION (by Target Variable!) task$col_roles$stratum =…
Ana
  • 115
  • 6
3
votes
1 answer

How to extract mlr3 tuned graph step by step?

My codes in following library(mlr3verse) library(mlr3pipelines) library(mlr3filters) library(paradox) filter_importance = mlr_pipeops$get( "filter", filter = FilterImportance$new(learner = lrn("classif.ranger", importance = "impurity")), …
BinhNN
  • 87
  • 7
3
votes
1 answer

Leave-One-Out Cross-Validation in mlr3

I like to use Leave-One-Out Cross-Validation in mlr3 (as part of a pipeline). I could specify the number of folds (=number of instances) e.g. via resampling = rsmp("cv", folds=task$nrow) But this refers explicitly to "task" which may not work in…
ds_col
  • 129
  • 10
3
votes
1 answer

how to repeat hyperparameter tuning (alpha and/or lambda) of glmnet in mlr3

I would like to repeat the hyperparameter tuning (alpha and/or lambda) of glmnet in mlr3 to avoid variability in smaller data sets In caret, I could do this with "repeatedcv" Since I really like the mlr3 family packages I would like to use them for…
ava
  • 840
  • 5
  • 19
3
votes
1 answer

Debugging / checking steps in mlr pipeops

I would like to check intermediate steps in a calculation, but I could not figure out how to do this. Example from the book: mutate = mlr_pipeops$get("mutate") filter = mlr_pipeops$get("filter", filter = mlr3filters::FilterVariance$new(), …
ds_col
  • 129
  • 10
3
votes
1 answer

Dealing with class imbalance with mlr3

Lately I have been advised to change machine learning framework to mlr3. But I am finding transition somewhat more difficult than I thought at the beginning. In my current project I am dealing with highly imbalanced data which I would like to…
Radbys
  • 400
  • 2
  • 10
1
2 3
17 18