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

Using pre-defined train and test sets in a benchmark in mlr3

I would like to compare several machine learning algorithms in a classification task using the benchmark_grid() function in mlr3. According to https://mlr3book.mlr-org.com/benchmarking.html benchmark_grid() takes a resampling scheme to partition the…
AW2
  • 53
  • 1
  • 7
0
votes
1 answer

Does resampling have to be instantiated in mlr3?

It was said that resampling object should be instantiated before training in mlr3 book. But sometimes it was not and can be trained and predicted successfully. I want to know when it should be instantiated with $instantiate(task) slot.
0
votes
0 answers

mlr3: visualization of lda-results in R other than stackedbarplot

I am pretty new to the work with R and ML in general. During programming my first LDA on 'real' data and not just a trainings set with the mlr3-package, I've successfully got a prediction output which looks well. mlr3viz provides the plotting of…
bienexo
  • 35
  • 6
0
votes
1 answer

R mlr3 TaskClassif 'termlabels' must be a character vector of length at least one

I am using mlr3 for a simple classification model. But I encounter errors with several different models which mlr3 gives access to. Here I provide one reprex to illustrate the…
Pizza-Fan
  • 1
  • 2
0
votes
1 answer

How to get mlr3 importance scores from learner?

How do I get importance scores? I tried this: task = tsk("iris") search_space = ParamSet$new( params = list( ParamDbl$new(id = "eta", lower = 0.2, upper = .4))) at = AutoTuner$new( learner = lrn("classif.xgboost"), resampling =…
Nip
  • 387
  • 4
  • 11
0
votes
0 answers

Is there a way to dynamically present mlr3 models?

I look for a way to present/publish a mlr3 model (an ensemble) online so that other researcher could apply the model with their data. I think shiny would be decent for that. I found mlr3shiny, however, as I understand it correctly, this package…
ava
  • 840
  • 5
  • 19
0
votes
1 answer

Why does my mlr3 classification task have no features?

I am trying to create a decision tree algorithm for a multiclass classification. I decided to use the mlr3 package in order to have maximum options for parameter tuning. However I seem to have problems with creating the classification task. The data…
0
votes
0 answers

ROC curves under diagonal with benchmark mlr3

May i ask stupid question. Why roc curves are under diagonal in benchmark case, and above diagonal in another. library(mlr3verse) library(mlr3viz) task = tsk("german_credit") design = benchmark_grid( tasks = task, learners =…
BinhNN
  • 87
  • 7
0
votes
1 answer

Crash in mlr3learners.lightgbm when load dplyr

I am using lightgbm in a mlr3 and wrangle Data uses functions from the dplyr. The R session in RStudio crashes when i load library(dplyr). library(dplyr) # crash if load library(mlr3) library(mlr3learners.lightgbm) task = mlr3::tsk("iris") learner…
BinhNN
  • 87
  • 7
0
votes
1 answer

How to map transform in r-drake

May i ask how to use function GraphLearner$new to transform in r-drake. The codes following: learner_plan = drake_plan( ## 1. Choose learner-------------------------------------------------------- polrn_classif =…
BinhNN
  • 87
  • 7
0
votes
0 answers

How to save 50% tuned results mlr3 and continue tune 50% tomorrow

Example codes library(mlr3verse) library(paradox) library(drake) my_plan = drake::drake_plan( # learner learner_classif = lrn( "classif.ranger", predict_type = "prob" ), # task task = tsk("german_credit"), # set…
BinhNN
  • 87
  • 7
0
votes
1 answer

R mlr3 create TaskregrST duplicate rows?

I have a dataframe called tab_mlr with coordinates about 19 features in 788 rows. str(tab_mlr) This object have 788 observations of 21 variables (with 2 variables as Latitude and Longitude). I create an sf object like this : data_mlr <-…
0
votes
1 answer

How to measure the performance of an mlr3 model in R?

I was wondering how to measure the performance of prediction (using the test dataset) of an mlr3 model? For example, if I create a knn model using mlr3 like so: library("mlr3") library("mlr3learners") # get data and split into training and test aq…
Electrino
  • 2,636
  • 3
  • 18
  • 40
0
votes
1 answer

randomForest in mlr3 throws error while calculating feature importance scores

I'm using mlr3 for a regression learning. While using randomForest for regression, the model runs fine but when I access 'importance()' I get the following error: Error in switch(pars[["importance"]], mse = imp[["%IncMSE"]], nodepurity =…
0
votes
0 answers

R session crashes while benchmarking in mlr3

I'm creating a design consisting of a set of tasks, imputation + learners (GraphLearner), and a CV-resampling. When I run all of it through 'benchmark' I get a R session crash (within RStudio) and I have to restart. I've tried it on 2 different PCs…