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

How to add a gradient function when using nloptr in the mlr3 tuning process

i try to use bfgs as a solver for the optimization problem in the mlr3 tuning step. I checked the documentation for how to add the gradient that the solver needs. Although i am able to add it in the pure nloptr , i find no way to do this in the…
Peter M.
  • 21
  • 2
2
votes
1 answer

mlr3 Tune on Multiple Measures & Distrcompositor

I get an error when I try to auto-tune on cindex and IBS. I can only use one performance measure. This is also the case for auto-selector that accepts only one performance measure. I also have a problem with distrcompositor to allow calculating IBS.…
Ali Alhadab
  • 101
  • 5
2
votes
0 answers

Difference in Computation Speed and Results Between MLR and MLR3

I don't get similar results when I use the same data and models using mlr and mlr3. Also I find mlr runs at least 20-fold faster. I used lung data from survival and I was able to replicate the difference in computation speed and results since I…
Ali Alhadab
  • 101
  • 5
2
votes
1 answer

MLR3 Survival Analysis: how to simultaneously perform feature selection & hyperparameter tuning together and get selected_features?

I am trying to fit coxph and parametric models and simultaneously perform feature selection and hyperparameter tuning. I have the following code below where I can use either auto_fselecter or auto_tuner inside resample but not both. How do I do…
Ali Alhadab
  • 101
  • 5
2
votes
1 answer

rsmp. How to create folds with custom size?

Here I create 3 folds with the same size task <- tsk("iris") folds <- rsmp("cv", folds = 3)$instantiate(task) Is is possible to create n folds, each with a different size?
Nip
  • 387
  • 4
  • 11
2
votes
1 answer

How to save mlr3 lightgbm model correctly?

I have some following codes. I met error when save trained model. It's only error when i using lightgbm. library(mlr3) library(mlr3pipelines) library(mlr3extralearners) data = tsk("german_credit")$data() data = data[, c("credit_risk", "amount",…
BinhNN
  • 87
  • 7
2
votes
2 answers

mlr3 - benchmarking: status messages are only displayed after full benchmark is completed

I would like to monitor the progress of benchmark() in mlr3. Benchmarking several models including hyperparameter tuning on a large data set can take hours or even days. I would like to be able to monitor the progress while benchmark is running, so…
AW2
  • 53
  • 1
  • 7
2
votes
1 answer

Is resampling re-run in every tuning evaluation?

I am experiencing difficulties trying to learn a model on the time series data. For this purpose I decided to use mlr3 framework and specifically mlr3tuning::AutoTuner function. The whole setup looks like this: at <- mlr3tuning::AutoTuner$new( …
Radbys
  • 400
  • 2
  • 10
2
votes
0 answers

Errors in mlr3 package using "surv.rfsrc" as a learner

When I try to running survival randomforest model in mlr3 using codes as below: data(veteran) veteran.xgb <- veteran[, !(names(veteran) %in% c("celltype"))] set.seed(1369) train = sample(nrow(veteran.xgb), 0.5 * nrow(veteran.xgb)) test =…
Yuan K
  • 31
  • 3
2
votes
0 answers

Quantile prediction for mlr3 graph learner

I have a stacked learner where the output layer is a regr.ranger with params list(rf.quantreg = TRUE, rf.keep.inbag = TRUE). Is it possible to predict quantiles with GraphLearners like this? I know that for a pure lrn('regr.ranger'), once trained, I…
Jonas Lindeløv
  • 5,442
  • 6
  • 31
  • 54
2
votes
1 answer

How to set 'importance' for finding variable importance for various regression learners in mlr3

while using regr.ranger I'm getting an error message that says importance.mode must be one of "impurity" etc. While using regr.rfsrc it says I should specify 'importance' to one of 'TRUE' etc. I just want to understand at what stage should I assign…
2
votes
1 answer

Unable to train dataset by mlr3proba after encoding and scaling it with mlr3pipeline

when I run the code below for training a model in mlr3proba after encoding and scaling my dataset with mlr3pipeline: task =tsk("sonar") learner = lrn("classif.rpart") measure = msr("classif.ce") inner.rsmp <- rsm("cv", folds = 5) train_set =…
Tuner
  • 56
  • 6
2
votes
1 answer

Error installing XML packege in R (libxml2)

I am trying to install the mlr3 library in R. THe XML library (one of the dependencies) gives me problems since it returns the following error: You are trying to use a version 2.* edition of libxml but an incompatible library. The header files and…
A1010
  • 360
  • 5
  • 18
2
votes
2 answers

how to change Beta value when using "classif.fbeta" as a performance measure in mlr3?

library(mlr3verse) preformace_msr <- msr("classif.fbeta", beta = 1.5) I am trying to use custom value of BETA in fbeta measure for classification model tuning. But the above way of trying to give beta value throws an error in mlr3. What is the right…
2
votes
1 answer

how to draw a calibration plot of a binary classifier in mlr3

In mlr there was a function to draw calibration plots: ## mlr approach # train predict library(mlr) lrn = makeLearner("classif.rpart", predict.type = "prob") mod = train(lrn, task = sonar.task) pred = predict(mod, task = sonar.task) # make…
ava
  • 840
  • 5
  • 19
1 2
3
17 18