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

Are mlr3 class weights applied to validation score calculations?

I have previously used mlr3 for imbalanced classification problems, and used PipeOpClassWeights to apply class weights to learners during training. This pipe op adds a column of observation weights to the Task, in the Task$weights property. These…
0
votes
1 answer

How Do I Perform Hyperparameter Optimization for a Non-Toy Dataset in R Using mlr3hyperband?

I have a dataset, let's call it "train.csv", train = na.omit(read_csv('train.csv')) that I want to use to train an XGBoost predictive model. Now under the example given by the mlr3hyperband documentation, the steps to perform hyperparameter…
0
votes
1 answer

Problem on Auto tune and custom resampling mlr3

I have some problems on my datas, I put again my native datas : structure(list(PatientID = c("P1", "P1", "P1", "P1", "P1", "P1", "P2", "P2", "P3", "P4", "P5", "P5", "P5", "P5", "P5", "P6", "P6", "P6"), LesionResponse = structure(c(2L, 1L, 2L,…
NDe
  • 71
  • 6
0
votes
1 answer

Change the resampling of an auto_tuner in mlr3

I am using mlr3 and I wanted to ask if it is possible to change the resampling method of an exiting auto_tuner(). Example: library(mlr3verse) # Some existing auto_tuner learner = lrn("classif.svm", cost = to_tune(1e-1, 1e5), gamma =…
Markus
  • 17
  • 5
0
votes
0 answers

Groupe and strata in mlr3

Hi everybody, I work actually on mlr3 and I was wondering if you could split your datas by grouping and stratify at the same time ? I saw on another topic that it was impossible...but is there no any solution ? I mean by this question that if I have…
NDe
  • 71
  • 6
0
votes
0 answers

mlr3, don't understand the splitting part

Hi everybody I'm new in the mlr3 universe and I'm currently trying to learn how to use it thanks to their book (https://mlr3book.mlr-org.com/Flexible-and-Robust-Machine-Learning-Using-mlr3-in-R.pdf). I'm trying also to apply their methodology to my…
NDe
  • 71
  • 6
0
votes
1 answer

Use mlr3hyperband with sobol sampling in the base stage

I have read in the mlr3hyperband documentation that on can define custom samplers (based on paradox::Sampler) for the initial base stage of each bracket. Now I was wondering if one could use that to implement some space filling design such as Sobol…
Markus
  • 17
  • 5
0
votes
1 answer

Extract predictions from all modles that are part of the pipeline using R mlr3

Below, I have created mlr3 graph and trained it on sample dataset. I know how to create predictions for final ste (regression average), but is it possible to get predictions for models before averaging? The goal is to compare individual model…
Mislav Sagovac
  • 185
  • 1
  • 8
0
votes
0 answers

Benchmarking mlr3 - build models that differ in included predictors?

I have data where the predictors have some natural grouping (some are questionnaire scores, some are biological variables). Is there any way to use the benchmarking in mlr3 to compare models based on this? I have tried to set it up, but it doesn't…
JacquieS
  • 43
  • 3
0
votes
1 answer

knn Imputation for features with mlr3 pipelines; tune value for k with nested resampling

I have another question concerning mlr3 pipelines. In my dataset some values are missing, so what I have learned from reading the literature it is best to delete the cases with missing values on the outcome and impute missing values in the features…
Hanna
  • 29
  • 2
0
votes
0 answers

Lasso learner classif.cv.glmnet in mlr3: Access the final model with lamda and β coefficients that is used for performance evaluation and prediction?

I am trying to do a lasso regression for a binary classification task in mlr3 using the learner lrn("classif.cv_glmnet"). My goal is to train this learner on the final task and access the model including the chosen lamda value (determined by cv) and…
Hanna
  • 29
  • 2
0
votes
1 answer

Accessing probabilities for PipeOps TwoClass Classif Learners

I am currently working on mlr3shiny. This program utilizes various mlr3 methods on an R shiny UI to make mlr3-models. I am currently unable to properly integrate the learner-objects to work with DALEX for model analysis. This problem arises only for…
0
votes
0 answers

Accounting for covariates (site effects) with mlr3 machine learning (pipelines)

I have gone through the entire mlr3 book but am unable to find a solution for how to address site effects in my data, as it comes from a multicenter study. I theoretically know about leave-site-out CV, but as the amount of participants coming from…
Hanna
  • 29
  • 2
0
votes
1 answer

mlr3 glmnet Repeated CV and Alpha/Lambda Tuning

I am hoping to use mlr3 to build multiple glmnet models (classification, regression, and survival). I was originally going to use the mlr3 associated cv_glmnet learners. However, in reading further, I'd like to tune both alpha and lambda like the…
DeLuca Lab
  • 13
  • 2
0
votes
1 answer

Define parameter1 as 1 - parameter2 using R paradox package

I want to define parameter1 as 1 - parameter2 using paradox package. That is parameter 1 depends on parameter 2 (depends argument doesn't help here I suppose). Here is my reserach space: search_space = ps( # preprocessing …
Mislav Sagovac
  • 185
  • 1
  • 8