Learn R Programming

⚠️There's a newer version (1.0.0) of this package.Take me there.

mlr3

A clean, object-oriented rewrite of mlr.

Installation

remotes::install_github("mlr-org/mlr3")

Why a rewrite?

mlr was first released to CRAN in 2013. Its core design and architecture date back even further. The addition of many features has led to a feature creep which makes mlr hard to maintain and hard to extend. We also think that while mlr was nicely extensible in some parts (learners, measures, etc.), other parts were less easy to extend from the outside. Also, many helpful R libraries did not exist at the time mlr was created, and their inclusion would result in non-trivial API changes.

Design principles

  • Only the basic building blocks for machine learning are implemented in this package.

  • Focus on computation here. No visualization or other stuff. That can go in extra packages.

  • Overcome the limitations of R's S3 classes with the help of R6.

  • Embrace R6, clean OO-design, object state-changes and reference semantics. This might be less "traditional R", but seems to fit mlr nicely.

  • Embrace data.table for fast and convenient data frame computations.

  • Combine data.table and R6, for this we will make heavy use of list columns in data.tables.

  • Be light on dependencies. mlr3 requires the following packages:

    • backports: Ensures backward compatibility with older R releases. Developed by members of the mlr team. No recursive dependencies.
    • checkmate: Fast argument checks. Developed by members of the mlr team. No extra recursive dependencies.
    • mlr3misc Miscellaneous functions used in multiple mlr3 extension packages. Developed by the mlr team. No extra recursive dependencies.
    • paradox: Descriptions for parameters and parameter sets. Developed by the mlr team. No extra recursive dependencies.
    • R6: Reference class objects. No recursive dependencies.
    • data.table: Extension of R's data.frame. No recursive dependencies.
    • digest: Hash digests. No recursive dependencies.
    • lgr: Logging facility. No extra recursive dependencies.
    • Metrics: Package which implements performance measures. No recursive dependencies.
    • mlbench: A collection of machine learning data sets. No dependencies.
  • Additional functionality that comes with extra dependencies:

Resources

Copy Link

Version

Install

install.packages('mlr3')

Monthly Downloads

8,539

Version

0.1.0-9000

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Michel Lang

Last Published

June 18th, 2025

Functions in mlr3 (0.1.0-9000)

Generator

Generator Class
Learner

Learner Class
Log

Learner Output Log
Measure

Measure Class
as_data_backend

Create a Data Backend
benchmark

Benchmark Multiple Learners on Multiple Tasks
mlr_generators_smiley

Smiley Classification Task Generator
mlr_generators_xor

XOR Classification Task Generator
mlr_resamplings_repeated_cv

Repeated Cross Validation Resampling
mlr_resamplings_subsampling

Subsampling Resampling
Resampling

Resampling Class
DataBackendDataTable

DataBackend for data.table
Task

Task Class
TaskClassif

Classification Task
DataBackendMatrix

DataBackend for Matrix
LearnerClassif

Classification Learner
PredictionRegr

Prediction Object for Regression
TaskRegr

Regression Task
LearnerRegr

Regression Learner
mlr_generators

Dictionary of Task Generators
mlr_generators_2dnormals

2d Normals Classification Task Generator
TaskSupervised

Supervised Task
ResampleResult

Container for Results of resample()
as.data.table

mlr_learners_classif.featureless

Featureless Classification Learner
mlr_measures_regr.mse

Mean Squared Error Regression Measure
BenchmarkResult

Container for Results of benchmark()
mlr_measures_elapsed_time

Elapsed Time Measure
mlr_assertions

Assertion for mlr3 Objects
MeasureClassif

Classification Measure
mlr_learners_classif.rpart

Classification Tree Learner
DataBackend

DataBackend
MeasureRegr

Regression Measure
mlr_control

Execution Control Object
mlr_learners

Dictionary of Learners
mlr_measures

Dictionary of Performance Measures
mlr_learners_classif.debug

Classification Learner for Debugging
mlr_resamplings_bootstrap

Bootstrap Resampling
mlr_resamplings

Dictionary of Resampling Strategies
mlr_reflections

Reflections for mlr3
mlr_resamplings_custom

Custom Resampling
mlr_tasks_pima

Pima Indian Diabetes Classification Task
mlr_measures_classif.acc

Accuracy Classification Measure
mlr_tasks_sonar

Sonar Classification Task
mlr_tasks_iris

Iris Classification Task
mlr_tasks_mtcars

"Motor Trend" Car Road Tests Task
mlr_tasks_spam

Spam Classification Task
Dictionary

Key-Value Storage
mlr_tasks

Dictionary of Tasks
Experiment

Experiment
Prediction

Abstract Prediction Object
mlr_tasks_bh

Boston Housing Regression Task
PredictionClassif

Prediction Object for Classification
expand_grid

Generate a Benchmark Design
mlr_tasks_zoo

Zoo Classification Task
resample

Resample a Learner on a Task
mlr3-package

mlr3: Machine Learning in R - Next Generation
mlr_learners_regr.featureless

Featureless Regression Learner
mlr_learners_regr.rpart

Regression Tree Learner
mlr_measures_classif.auc

Area Under the Curve Classification Measure
mlr_measures_classif.mmce

Mean Misclassification Error Measure
mlr_resamplings_cv

Cross Validation Resampling
mlr_resamplings_holdout

Holdout Resampling
mlr_measures_selected_features

Selected Features Measure
mlr_measures_classif.costs

Cost-sensitive Classification Measure
mlr_measures_regr.mae

Absolute Errors Regression Measure
mlr_measures_classif.confusion

Binary Classification Measures Derived from a Confusion Matrix
mlr_measures_classif.f1

F1 Classification Measure
mlr_tasks_wine

Wine Classification Task
mlr_measures_oob_error

Out-of-bag Error Measure
mlr_measures_classif.ce

Classification Error Measure
cast_from_dict

Cast objects using a Dictionary
MeasureOOBError

Out-of-bag Error Measure
LearnerClassifDebug

Classification Learner for Debugging
MeasureClassifCosts

Cost-sensitive Classification Measure
LearnerClassifFeatureless

Featureless Classification Learner
MeasureClassifAUC

Area Under the Curve Classification Measure
MeasureSelectedFeatures

Selected Features Measure
LearnerRegrFeatureless

Featureless Regression Learner
GeneratorSmiley

Smiley Classification Task Generator
GeneratorXor

XOR Classification Task Generator
ResamplingBootstrap

Bootstrap Resampling
MeasureClassifF1

F1 Classification Measure
ResamplingCV

Cross Validation Resampling
MeasureClassifACC

Accuracy Classification Measure
ResamplingCustom

Custom Resampling
MeasureClassifCE

Classification Error Measure
MeasureClassifConfusion

Binary Classification Measures Derived from a Confusion Matrix
Generator2DNormals

2d Normals Classification Task Generator
LearnerClassifRpart

Classification Tree Learner
LearnerRegrRpart

Regression Tree Learner
ResamplingRepeatedCV

Repeated Cross Validation Resampling
MeasureElapsedTime

Elapsed Time Measure
MeasureRegrMAE

Absolute Errors Regression Measure
MeasureRegrMSE

Mean Squared Error Regression Measure
ResamplingSubsampling

Subsampling Resampling
ResamplingHoldout

Holdout Resampling
mlr_tasks_boston_housing

Boston Housing Regression Task
mlr_tasks_german_credit

German Credit Classification Task
GeneratorFriedman1

Friedman1 Regression Task Generator
convert_prediction

as_prediction_data