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 tune a vector of two values in mlr3

The survival SVM model using hybrid approach requires gamma.mu to be a vector as below. How can we tune gamma.mu in this case? lrn("surv.svm", type = "hybrid", diff.meth = "makediff3", gamma.mu=c(0.1, 0.1))
Ali Alhadab
  • 101
  • 5
1
vote
1 answer

How to predict new datasets after the `tune_nested`?

# retrieve task task = tsk("pima") # load learner and set search space learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)) # nested resampling rr = tune_nested( method = "random_search", task = task, learner =…
ayue
  • 31
  • 3
1
vote
1 answer

mlr3 AutoFSelector glmnet: Error in (if(cv)glmnet::cv.glmnet else glmnet::glmnet)(x = data, y = target, :# x should be a matrix with 2 or more columns

I am a beginner on mlr3 and am facing problems while running AutoFSelector learner associated to glmnet on a classification task containing >2000 numeric variables. I reproduce this error while using the simpler mlr3 predefined task Sonar. For note,…
Clem
  • 13
  • 3
1
vote
1 answer

How to impute for resampling rather than embedding imputation pipeline with a learner, especially for nested cross validation?

I want to first do imputation within each cv fold and then train the learner with autotuner, and test it on testing sets. I can see that once the resampling scheme is fixed, the imputation is fixed, so that only (inner folds) * (outer folds)…
1
vote
0 answers

How to Impute missing values by bag and KNN in MLR3

I want to impute missing values by bag and KNN. how do I do that with MLR3 correctly? Looking at some examples, it seems possible using mlr3pipelines but not 100% sure po("imputelearner", lrn(bag or knn learners)). When I tried it, I have a problem…
Ali Alhadab
  • 101
  • 5
1
vote
1 answer

How do I save my model to use in another project in mlr3?

I would like to divide my working pipeline in 2: One place (internal) where to benchmark and auto-tune the alrithms to select the final model. Apply the selected models to new datasets (external). For the second part, I will need to somehow save…
alessio619
  • 21
  • 4
1
vote
1 answer

How to subset a PredictionClust/Prediction/R6 object

I have a clustering task with about 500k datapoints. I want to plot the clusters but my machine can't handle an autoplot() with that amount of data. What are the alternatives? Is it possible to plot only the contours or maybe subset the prediction…
Alberson Miranda
  • 1,248
  • 7
  • 25
1
vote
0 answers

Is it true that parameter C cannot be optimized for 'nu-svr' or is it an error?

I am trying to optimize an SVR model within the mlr3 ecosystem with the kernlab package and I am getting the following error: The parameter 'C' can only be set if the following condition is met 'type {eps-svr, eps-bsvr}'. Instead the…
1
vote
1 answer

Tune a learner with the searchspace parameter setting

I am trying to tune a ranger learner with the searchspace parameter setting. The purpose is to find the optimal K (the number of input indicators, I uesd a filterpipe with setting importance.filter.nfeat) and D (the depth of each tree, i.e.,…
LengJH
  • 23
  • 4
1
vote
0 answers

MLR3 vs. cv.glmnet tuning speed

I have a small dataset I am trying to train random forest and lasso models on. If I run cv.glmnet from glmnet, it performs k-fold CV and finds optimal lambda within 1 second. If I set up an AutoTuner from MLR3 and train it in the same manner, it…
Michael Connor
  • 473
  • 1
  • 4
  • 9
1
vote
1 answer

How to interpret the tuning result of the GraphLearner with branches in mlr3?

Recently I follow some tutorials to learn how to use the GraphLearner in mlr3. But I am still confused about the tuning result of the GraphLearner with branch. I set up a simple example, Here is my codes: # Create a Graph with Branch graph_branch <-…
Kim.L
  • 121
  • 10
1
vote
1 answer

How to get the model results from the benchmarkresult in mlr3?

Recently I was learning about using mlr3 package. I was doing a feature selection and wanted to compare the model results.However, I wonder how to get the model results from a Benchmarkresult, like what features were uesd in the feature selected…
LengJH
  • 23
  • 4
1
vote
0 answers

Why am I getting a missing value for the standard errors when using ranger package through mlr3? My data set has no missing values

My data set (be) is just a generic series and I am using 2 lagged values of the series as predictors. When I run ranger through mlr3 I get an error saying there are missing values in pdata$se, don't know what is wrong, there are no missing values…
sagrules
  • 31
  • 1
  • 7
1
vote
1 answer

pipeops makes paramter not available for tuning in mlr3proba

I am using mlr3proba package for machine learning survival analysis. My dataset contains factor, numeric and integer features. I used 'scale' and 'encode' pipeops to preprocess my dataset for deephit and deepsurv neural network methods as following…
Behnam Hedayat
  • 837
  • 4
  • 18
1
vote
1 answer

How to transform '2 levels ParamUty' class in nested cross-validation of mlr3proba?

For survival analysis, I am using mlr3proba package of R. My dataset consists of 39 features(both continuous and factor, which i converted all to integer and numeric) and target (time & status). I want to tune hyperparameter: num_nodes, in…
Behnam Hedayat
  • 837
  • 4
  • 18