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
2
votes
1 answer

Benchmarking multiple AutoTuning instances

I have been trying to use mlr3 to do some hyperparameter tuning for xgboost. I want to compare three different models: xgboost tuned over just the alpha hyperparameter xgboost tuned over alpha and lambda hyperparameters xgboost tuned over alpha,…
frankp4
  • 23
  • 3
2
votes
2 answers

How to change column names to comply to mlr3's naming convention

I want to perform a text-classfication with many (>50K) tokens as feature names. However the Task() functions in mlr3 do not allow many characters in column names, which are passed by make.names and are otherwise fine. Here is a list of them that I…
krltrl
  • 60
  • 6
2
votes
2 answers

mlr3 - Editing `task$data()`

Is there a way to edit task$data() or replace it with a new data.frame() with exactly the same colnames? I've tried the following task_train$data() <- newDF and task_train$data <- newDF. They both result in Error in task_train$data() <- di : invalid…
Nip
  • 387
  • 4
  • 11
2
votes
1 answer

mlr3 - confidence interval for predictions

After tuning a learner and using it, we can use it to make predictions through the command line predict(Learner, newdata, predict_type="response") But, how do we compute confidence intervals for predictions? task <- TaskRegr$new("data", data,…
Nip
  • 387
  • 4
  • 11
2
votes
1 answer

Why is xgboost not calculating the importance for all variables when using it with mlr3?

So, im using the superconductivity dataset found here... It contains 82 variables and I am subsetting the data to 2000 rows. But when I use xgboost with mlr3 it does not calculate the importance for all the variables!? Here's how I'm setting…
Electrino
  • 2,636
  • 3
  • 18
  • 40
2
votes
1 answer

How to set specific values in `paradox`?

Is there a way to set particular values of parameters in the R package paradox? Say I do hyperparameter tuning for a random forest method and I want to test for mtry = c(2, 3, 7, 8) and min.node.size = c(2, 5, 7), i.e., a 4 x 3 grid with non-equal…
Jonas Lindeløv
  • 5,442
  • 6
  • 31
  • 54
2
votes
2 answers

mlr3's task$feature_names is re-ordering variables in R?

So my issue is, when I have a data frame and then create a task using mlr3's task$feature_names function, it is returning the variables in alphabetical or a (kind of) incorrect numerical order, whereas I would like to keep the order that the feature…
Electrino
  • 2,636
  • 3
  • 18
  • 40
2
votes
1 answer

How to subset task according to indicator column and batch train-predict in mlr3?

Background I'm modeling and predicting with the mlr3 package in R. I'm working with one big data set that consists out of test and train sets. Test and train sets are indicated by an indicator column (in code: test_or_train). Goal Batch train all…
Shudras
  • 117
  • 2
  • 8
1
vote
1 answer

MLR3 : ROC curves and extraction of standard deviation/IC?

I want to extract the standard deviation and/or an IC95 of the result obtain in a benchmark of multiple learners on a task in order to ensure that the results are complete. I read this : mlr3 standard deviation for k-fold cross-validation…
NDe
  • 71
  • 6
1
vote
1 answer

Create a stack model with the package mlr3

I'm using the mlr3pipelines package to It define a pipeline object named "stack" which is used for stacking ensemble learning. However, I'm unable to find an alternative to the 'po' function, it's not suitable for stacking models as I get this…
Programming Noob
  • 1,232
  • 3
  • 14
1
vote
1 answer

How to extract lambda value from mlr3's cv.glmnet learner after benchmarking grid?

I am currently doing a regression using mlr3 lrn('regr.cv_glmnet'). I am doing a benchmark grid to determine whether linear regression vs cross validated lasso works better. By using default values with regr.cv_glmnet, the lasso works better, but I…
Tan YX
  • 11
  • 1
1
vote
2 answers

Extract weights from fitted regr.nnet object in mlr3

This question is related to the solution provided by @Sebastian for a previous question. It showed how to do repeated training for a regr.nnet learner using a custom (=fixed) resampling strategy and cloned…
tpetzoldt
  • 5,338
  • 2
  • 12
  • 29
1
vote
1 answer

Multiple runs and interaction terms in mlr3 regr.nnet task

I am trying to port a few didactical examples from packages nnet, neuralnet and ranger to package mlr3. I like the way how mlr3 can handle fitted models, e.g. model evaluation, feature importance or hyperparameter optimization, but have still a few…
tpetzoldt
  • 5,338
  • 2
  • 12
  • 29
1
vote
1 answer

Set 3 double parameters in p_db using paradox package

How can I set parameter with say 3 float values. For example I want to search parameter X for 0.99, 0.98 and 0.97. For p_dbl there are lower and upper parameters but not values I can use. For example something like (this doesn't work…
Mislav Sagovac
  • 185
  • 1
  • 8
1
vote
1 answer

Variable Importance P-Values

Can the importance_pvalues (https://rdrr.io/cran/ranger/man/importance_pvalues.html) command be used via mlr3? In other words, can I indicate that I would like the p-values outputted in my call to the learner? If not, how would I go about extracting…
DeLuca Lab
  • 13
  • 2