Learn R Programming

⚠️There's a newer version (0.23.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.
  • Reflections: Objects are queryable for properties and capabilities, allowing you to programm on them.
  • Additional functionality that comes with extra dependencies:

Resources

Copy Link

Version

Install

install.packages('mlr3')

Monthly Downloads

8,822

Version

0.1.0

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Michel Lang

Last Published

March 12th, 2025

Functions in mlr3 (0.1.0)

GeneratorFriedman1

Friedman1 Regression Task Generator
BenchmarkResult

Container for Results of benchmark()
GeneratorXor

XOR Classification Task Generator
DataBackendMatrix

DataBackend for Matrix
DataBackendDataTable

DataBackend for data.table
DataBackend

DataBackend
Learner

Learner Class
GeneratorSmiley

Smiley Classification Task Generator
Generator

Generator Class
Generator2DNormals

2d Normals Classification Task Generator
LearnerRegrRpart

Regression Tree Learner
LearnerRegr

Regression Learner
LearnerRegrFeatureless

Featureless Regression Learner
MeasureElapsedTime

Elapsed Time Measure
MeasureClassifF1

F1 Classification Measure
LearnerClassifFeatureless

Featureless Classification Learner
MeasureClassifConfusion

Binary Classification Measures Derived from a Confusion Matrix
LearnerClassifRpart

Classification Tree Learner
MeasureClassifCosts

Cost-sensitive Classification Measure
PredictionClassif

Prediction Object for Classification
Resampling

Resampling Class
ResampleResult

Container for Results of resample()
ResamplingCustom

Custom Resampling
benchmark

Benchmark Multiple Learners on Multiple Tasks
ResamplingHoldout

Holdout Resampling
Task

Task Class
MeasureClassifACC

Accuracy Classification Measure
MeasureRegrMAE

Absolute Errors Regression Measure
ResamplingBootstrap

Bootstrap Resampling
MeasureClassif

Classification Measure
cast_from_dict

Cast objects using a Dictionary
mlr_measures

Dictionary of Performance Measures
MeasureRegrMSE

Mean Squared Error Regression Measure
MeasureOOBError

Out-of-bag Error Measure
Measure

Measure Class
PredictionRegr

Prediction Object for Regression
ResamplingCV

Cross Validation Resampling
mlr_learners

Dictionary of Learners
mlr_tasks_sonar

Sonar Classification Task
mlr_tasks_pima

Pima Indian Diabetes Classification Task
mlr_generators

Dictionary of Task Generators
ResamplingRepeatedCV

Repeated Cross Validation Resampling
mlr_control

Execution Control Object
ResamplingSubsampling

Subsampling Resampling
mlr_reflections

Reflections for mlr3
mlr_tasks_german_credit

German Credit Classification Task
mlr_assertions

Assertion for mlr3 Objects
TaskClassif

Classification Task
TaskRegr

Regression Task
mlr_tasks_spam

Spam Classification Task
TaskSupervised

Supervised Task
MeasureRegr

Regression Measure
mlr_tasks_wine

Wine Classification Task
mlr_resamplings

Dictionary of Resampling Strategies
mlr_tasks_zoo

Zoo Classification Task
mlr_tasks

Dictionary of Tasks
resample

Resample a Learner on a Task
LearnerClassif

Classification Learner
as_data_backend

Create a Data Backend
mlr_tasks_boston_housing

Boston Housing Regression Task
mlr3-package

mlr3: Machine Learning in R - Next Generation
MeasureClassifCE

Classification Error Measure
LearnerClassifDebug

Classification Learner for Debugging
MeasureClassifAUC

Area Under the Curve Classification Measure
as.data.table

MeasureSelectedFeatures

Selected Features Measure
mlr_tasks_iris

Iris Classification Task
Prediction

Abstract Prediction Object
expand_grid

Generate a Benchmark Design
mlr_tasks_mtcars

"Motor Trend" Car Road Tests Task