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

MLR3 using trafo (transformations) within a learner branch/dependencies hitting "non-numeric argument" error when transposing

I'm trying to tune a few models using instances, so there is a branching step with several models. I have the pipe constructed and works without models that require trafos. The parameters are set, and the dependencies work fine. I'm using trafos…
3
votes
0 answers

MLR3 using data transforms in bootstrapping hit an error

I'm trying to use bootstrapping resampling as my cross-validation in mlr3, and have been tracking down the cause of an error: Error in as_data_backend.data.frame(backend, primary_key = row_ids) : Assertion on 'primary_key' failed: Contains…
3
votes
1 answer

Roc curves with mlr3::autoplot() for benchmark with "holdout" resampling

I am using the mlr3 package and I want to plot ROC curves for different models. If I use cross validation as explained in the documentation it works perfectly well, but if I use "holdout" for the resampling then I get an error Error: Invalid…
maRmat
  • 363
  • 1
  • 14
3
votes
1 answer

Where does mlr3 save the final model?

Where does mlr3 save the final model, after training a learner --- learner$train(data)? By "final model", I mean something like a list produced by the following code: model <- xgboost::xgb.train(data = data_train, …
Nip
  • 387
  • 4
  • 11
3
votes
2 answers

Is there a way to group rows (especially dummy variables) in the recipes package in R (or ml3)

# Packages library(dplyr) library(recipes) # toy dataset, with A being multicolored df <- tibble(name = c("A", "A", "A", "B", "C"), color = c("green", "yellow", "purple", "green", "blue")) #> # A tibble: 5 x 2 #> name color #> …
JeromeLaurent
  • 327
  • 3
  • 10
3
votes
0 answers

How to access and compare LASSO model coefficients with MLR3 (glmnet learner)?

Goal Create a LASSO model using MLR3 Use nested CV with inner CV or bootstraps for hyperparameter (lambda) determination and outer CV for model performance evaluation (instead of doing just one test-train spit) and finding the standard deviation of…
Shudras
  • 117
  • 2
  • 8
3
votes
1 answer

mlr3 predictions to new data with parameters from autotune

I have a follow-up question to this one. As in the initial question, I am using the mlr3verse, have a new dataset, and would like to make predictions using parameters that performed well during autotuning. The answer to that question says to use…
Helen S
  • 49
  • 5
3
votes
2 answers

mlr3 PipeOps: Create branches with different data transformations and benchmark different learners within and between branches

I'd like use PipeOps to train a learner on three alternative transformations of a dataset: No transformation. Class balancing- down. Class balancing- up. Then, I'd like to benchmark the three learned models. My idea was to set up the pipeline as…
3
votes
1 answer

How use predict to new data?

I would like to make predictions using created model by mlr3 package for new data that are previously unknown. I trained model by using AutoTuner function. I read chapter "3.4.1.4 Predicting" of mlr3 book, but the solution is not useful for my…
nukubiho
  • 313
  • 1
  • 8
2
votes
1 answer

Term_evals when finding hyper parameters for XGBoost with #mlr3

I'm new to gradient boosting (XGBoost). I've read the manual for mlr3, and if I understand it right, I want to first tune my hyper parameters. I'm unsure for this how to set term_evals? In the tutorial, it uses a very small number and says for real…
JacquieS
  • 43
  • 3
2
votes
1 answer

mlr3 properly setting up parallelization

Say I have a machine with 32 cores and want to execute a nested CV of 5 outer folds and 3 inner folds as efficiently as possible. On the outer fold, I benchmark two or more learners, on the inner fold I tune hyperparams for one or n-k of the…
persephone
  • 380
  • 2
  • 10
2
votes
2 answers

Rewriting ParamSet ids from mlr3::paradox()

Let's say I have the following ParamSet object: my_ps = paradox::ps( minsplit = p_int(1, 64, logscale = TRUE), cp = p_dbl(1e-04, 1, logscale = TRUE)) Is it possible to rename minsplit to survTree.minsplit without changing anything else? The…
John
  • 359
  • 4
  • 19
2
votes
1 answer

How to save a ranger model in mlr3 without data?

I have created a ranger model using mlr3 library. I saved this model to my machine using following command. The created file is huge in size. The saved file also has the data along with the model. Is there a way to only save the model without the…
Saurabh
  • 1,566
  • 10
  • 23
2
votes
1 answer

Setting `early_stopping_rounds` in xgboost learner using mlr3

I want to tune an xgboost learner and set the parameter early_stopping_rounds to 10% of the parameter nrounds (whichever is generated each time). Should be a simple thing to do in general (i.e. tuning a parameter relative to another) but I can't…
John
  • 359
  • 4
  • 19
2
votes
1 answer

How do I set the upper range mtry tuning value in mlr3, when I also conduct automated feature selection?

Date: 2022-08-17. R Version: 4.0.3. Platform: x86_64-apple-darwin17.0 (64-bit) Problem: In mlr3 (classif.task, learner: random forest), I use automated hyperparameter optimization (HPO; mtry in the range between 1 and the number of features in the…
Marcel
  • 23
  • 2
1
2
3
17 18