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
1
vote
2 answers

Apply Models from Nested Resample to Permuted Dataset

I have generated a nested resampling object with the following code: data<-read.csv("Data.csv", row.names=1) data$factor<-as.factor(data$factor) set.seed(123, "L'Ecuyer") task = as_task_classif(data, target = "factor") learner =…
1
vote
1 answer

Predict on holdout set using mlr3

I am using mlr3 package. I set roles of some rows to "holdout" and than trained the model: library(mlr3) # train on iris task = tsk("iris") task$nrow task$set_row_roles(130:150, "holdout") learner = lrn("classif.rpart") learner$train(task) How can…
Mislav Sagovac
  • 185
  • 1
  • 8
1
vote
1 answer

mlr3 standard deviation for k-fold cross-validation resampling

Anybody know how to extract the standard deviation for a ResampleResult/BenchmarkResult in mlr3? The implemented metrics seems to be returning only the average value. measures <- list( mlr3::msr("classif.fbeta", predict_sets = "train", id =…
1
vote
1 answer

How do I tune random forest with oob error?

Instead of doing a CV and train the Random Forest multiple times I would like to use the OOB Error as and unbiased estimation of the generalized error. And for a few data points (in the low thousands), does it make sense to use the OOB error instead…
Seb
  • 13
  • 2
1
vote
0 answers

get coefficients and features from a glmnet learner #mlr3

Thanks for providing the mlr3 package in R , since I am trying it for the first time simple code in mlr3: learner = lrn("classif.cv_glmnet") lrn_glmnet <- learner$train(task, row_ids = train_set). my question is how to get the features and…
Haneme
  • 11
  • 2
1
vote
1 answer

How to obtain out of sample predictions on new data with mlr3 resample stored models?

I want to use mlr3 for cross-fitting of nuisance parameters in a semi-parametric model such as TMLE or AIPW. The cross-fitting procedure is similar to k-fold cross-validation; split the data into K sets of somewhat equal size, obtain predictions for…
N. Williams
  • 175
  • 11
1
vote
1 answer

Imputation of target using mlr3

After studying the sources describing mlr3 and looking at the given examples I still couldn't find any answer about how to impute the target variable during a regression task, when it has missings. I want to use Ranger, but it can't deal with…
Nucore
  • 107
  • 1
  • 13
1
vote
1 answer

How to set the graph learner id in mlr3pipelines?

I construct a benchmark with 4 graph learners on 1 dataset. The learner_id of the result of the benchmark is so long because I have some preprocessings. How can I set the learner id so that it wouldn't too long. Here's my code: # step 1 the…
Yue Li
  • 13
  • 2
1
vote
1 answer

How to set "budget" tag for xgboost hyperband optimization with mlr3tuningspaces?

I am trying to tune xgboost with hyperband and I would like to use the suggested default tuning space from the mlr3tuningspaces package. However, I don't find how to tag a hyperparameter with "budget" while using lts . Below, I reproduced the…
user2165907
  • 1,401
  • 3
  • 13
  • 28
1
vote
0 answers

mlr3: extract variable importance for each resampling iteration

I would like to extract variable importance for each resampling iteration with mlr3. So far, I have only found a "manual" way of doing it so I was wondering if there was a wrapper function or some other way to do it. Below is a toy example with…
user2165907
  • 1,401
  • 3
  • 13
  • 28
1
vote
0 answers

feature importance in mlr3 with iml for classification forests

I calculate feature importance for 2 different types of machine learning models (SVM and Classification Forest). I cannot post the data here, but I describe what I do: My (classification) task has about 400 observations of 70 variables. Some of them…
ds_col
  • 129
  • 10
1
vote
1 answer

I need good model serialization. Default R serialization is nighter safe nor effective from the point of model size

MLR3 model includes a lot of redundant data not needed when applying the model. The traditional R approach is to save all the data used for model training. It leads to the growth of used memory. What leads to the growth of used memory. In the…
1
vote
1 answer

mlr3 survival distribution estimation at specific time-points

I'm looking for a faster way to extract predicted survival distributions with mlr3 and mlr3proba. The prediction procedure is highly time-consuming, expecially using datasets with hundreds of observations and without ties in time variable. Does it…
1
vote
1 answer

How to perform spatial crossvalidation using mlr3 and then perform raster predict

I have the following problem. I want to build a model for landcover classification. My data are multitemporal Remote Sensing data with several bands. For training I created stratified randomly distributed points to extract spectral data at their…
nvnor
  • 13
  • 3
1
vote
0 answers

How to combine autofselector and autotuner models in a Benchmark

How I can make a list of learners including autofselector and autotuner in benchmark and compare their performance? I wonder how to rank learners stratified by task when we have multiple tasks library(mlr3verse) mod1 = AutoTuner$new( …
Ali Alhadab
  • 101
  • 5