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

How to access the measure(eg:"classif.acc" or other measures) of the train set if I use "holdout" resampling?

I'm learning the mlr3 package for machine learning in R. I split the data into the train set and test set using the "holdout" resampling, how can I get the measure of the train set? It seems that it only gives the measure of the test set even if I…
ayue
  • 31
  • 3
1
vote
1 answer

How to fix PipeOP's state?

How can we Fix a PipeOp's $state, so that its parameters or config are fixed from the beginning and remain the same in both training and prediction. task = tsk("iris") pos1 = po("scale", param_vals =list( center = T, scale = T, …
Nip
  • 387
  • 4
  • 11
1
vote
1 answer

mlr3 - how to remove incomplete observations using `mlr3` interface

Is it possible to remove incomplete observation within a task --- task <- TaskRegr$new("data", data, "y") --- using mlr3 filters or pipeops?
Nip
  • 387
  • 4
  • 11
1
vote
1 answer

mlr3: obtaining response (predicted survival time) from surv.gbm

surv.gbm in the mlr3 framework outputs linear predictors, however what I'm really interested in are predicted survival times per case, which I want to compare with the actual survival times. Is there a way to obtain actual survival times? In the…
pmakai
  • 13
  • 3
1
vote
1 answer

Create branches with different subsets of data with mlr3 PipeOps

I want to train models on different subsets of data using mlr3, and I was wondering if there a way to train models on different subsets of data in a pipeline. What I want to do is similar to the example from R for Data Science - Chapter 25: Many…
ialm
  • 8,510
  • 4
  • 36
  • 48
1
vote
1 answer

How to filter mlr3 task dataset by feature value

I have a mlr3 task, where I have dataset like this: Dataset "all" all <- data.frame(v1 = c("a", "b"), v2 = c(1, 2), data = c("test", "train")) library(mlr3) task <- TaskClassif$new("loan", all, target = "v1") How could…
Jānis
  • 57
  • 6
1
vote
1 answer

MLR 3 Learners contains 5 learner only?

I am learning new MLR environment using MLR3 Compared to MLR, I can get the learners list using: library(mlr) ListLearners() in MLR3, I get the learners list using: library(mlr3) mlr_learners with 5 stored values Keys:…
Jovan
  • 763
  • 7
  • 26
1
vote
1 answer

Variable importance not defined in mlr3 rpart learner

I trained and tested a decision tree classifier with mlr3 package in R: pred_probability = learner_DT$train(task_train)$predict(task_test) How can I get the variable importance from this model? I tried learner_DT$importance() but the outcome was…
user9439906
  • 433
  • 2
  • 7
  • 17
1
vote
1 answer

Element with key 'surv.xgboost' not found in DictionaryLearner

I am using R version 3.6.3, mlr3 version 0.3.0 and mlr3proba version 0.1.6 (the latest development versions I could find) and xgboost version 0.90.0.2 → I am trying to use the command: lrn("surv.xgboost") but I receive the error message: Error:…
EvangelosK
  • 17
  • 4
1
vote
1 answer

Combining rpart hyper tuning parameters with down sampling in MLR3

I am walking through great examples from the MLR3 package (mlr3gallery:imbalanced data examples), and I was hoping to see an example that combines hyper parameter tuning AND an imbalance correction. From the link above, as description of what I am…
snowkeep
  • 107
  • 4
1
vote
1 answer

Tuning SMOTE's K with a trafo fails: 'warning("k should be less than sample size!")'

I'm having trouble with the trafo function for SMOTE {smotefamily}'s K parameter. In particular, when the number of nearest neighbours K is greater than or equal to the sample size, an error is returned (warning("k should be less than sample…
1
vote
1 answer

Custom Precision-Recall AUC measure in mlr3

I would like to create a custom Precision-Recall AUC measure in mlr3. I am following the mlr3 book chapter on creating custom measures. I feel I'm almost there, but R throws an annoying error that I don't know how to interpret. Let's define the…
1
vote
1 answer

mlr_measures_classif.costs with predict_type = "prob"

The cost-sensitive measure mlr_measures_classif.costs requires a 'response' predict type. msr("classif.costs") # #* Packages: - #* Range: [-Inf, Inf] #* Minimize: TRUE #* Properties: requires_task #* Predict type:…
1
vote
1 answer

mlr3 resample autotuner - not showing tuned parameters?

I'm fairly new to mlr3, and have had issues in both getting the tuned hyper-parameters (from each of the cross validations), as well as the optimised hyper parameters using the AutoTuner method (to make use of nested resampling). My understanding is…
May Phang
  • 13
  • 3
1
vote
1 answer

How to impute data with mlr3 and predict with NA values?

I followed the documentation of mlr3 regarding the imputation of data with pipelines. However, the mode that I have trained does not allow predictions if a one column is NA Do you have any idea why it doesn't work? train…
ZchGarinch
  • 295
  • 3
  • 13