mlr3

mlr3: A modern object-oriented machine learning framework in R - Published in JOSS (2019)

https://github.com/mlr-org/mlr3

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    4 of 30 committers (13.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

classification data-science machine-learning mlr3 r r-package regression

Keywords from Contributors

reproducibility parallel-computing slurm batchexperiments batchjobs docker-swarm hpc-clusters lsf openlava sge
Last synced: 4 months ago · JSON representation

Repository

mlr3: Machine Learning in R - next generation

Basic Info
  • Host: GitHub
  • Owner: mlr-org
  • License: lgpl-3.0
  • Language: R
  • Default Branch: main
  • Homepage: https://mlr3.mlr-org.com
  • Size: 40.5 MB
Statistics
  • Stars: 1,028
  • Watchers: 27
  • Forks: 93
  • Open Issues: 27
  • Releases: 44
Topics
classification data-science machine-learning mlr3 r r-package regression
Created over 7 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.Rmd

---
output: github_document
---

```{r, include = FALSE}
lgr::get_logger("mlr3")$set_threshold("warn")
set.seed(1)
options(datatable.print.class = FALSE, datatable.print.keys = FALSE)
```

# mlr3 

Package website: [release](https://mlr3.mlr-org.com/) | [dev](https://mlr3.mlr-org.com/dev/)

Efficient, object-oriented programming on the building blocks of machine learning.
Successor of [mlr](https://github.com/mlr-org/mlr).


[![r-cmd-check](https://github.com/mlr-org/mlr3/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/mlr-org/mlr3/actions/workflows/r-cmd-check.yml)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.01903/status.svg)](https://doi.org/10.21105/joss.01903)
[![CRAN Status](https://www.r-pkg.org/badges/version-ago/mlr3)](https://cran.r-project.org/package=mlr3)
[![Mattermost](https://img.shields.io/badge/chat-mattermost-orange.svg)](https://lmmisld-lmu-stats-slds.srv.mwn.de/mlr_invite/)


## Resources (for users and developers)

* We have written a [book](https://mlr3book.mlr-org.com/).
  This should be the central entry point to the package.
* The [mlr-org website](https://mlr-org.com/) includes for example a [gallery](https://mlr-org.com/gallery.html) with case studies.
* [Reference manual](https://mlr3.mlr-org.com/reference/)
* [FAQ](https://mlr-org.com/faq.html)
* Ask questions on [Stackoverflow (tag #mlr3)](https://stackoverflow.com/questions/tagged/mlr3)
* **Extension Learners**
  - Recommended core regression, classification, and survival learners are in [mlr3learners](https://github.com/mlr-org/mlr3learners)
  - All others are in [mlr3extralearners](https://github.com/mlr-org/mlr3extralearners)
  - Use the [learner search](https://mlr-org.com/learners.html) to get a simple overview
* **Cheatsheets**
  - [Overview of cheatsheets](https://cheatsheets.mlr-org.com)
  - [mlr3](https://cheatsheets.mlr-org.com/mlr3.pdf)
  - [mlr3tuning](https://cheatsheets.mlr-org.com/mlr3tuning.pdf)
  - [mlr3pipelines](https://cheatsheets.mlr-org.com/mlr3pipelines.pdf)
* **Videos**:
  - [useR2019 talk on mlr3](https://www.youtube.com/watch?v=wsP2hiFnDQs)
  - [useR2019 talk on mlr3pipelines and mlr3tuning](https://www.youtube.com/watch?v=gEW5RxkbQuQ)
  - [useR2020 tutorial on mlr3, mlr3tuning and mlr3pipelines](https://www.youtube.com/watch?v=T43hO2o_nZw)
  
* **Courses/Lectures**
  - The course [Introduction to Machine learning (I2ML)](https://slds-lmu.github.io/i2ml/) is a free and open flipped classroom course on the basics of machine learning. `mlr3` is used in the [demos](https://github.com/slds-lmu/lecture_i2ml/tree/master/code-demos-pdf) and [exercises](https://github.com/slds-lmu/lecture_i2ml/tree/master/exercises).
* **Templates/Tutorials**
  - [mlr3-targets](https://github.com/mlr-org/mlr3-targets): Tutorial showcasing how to use {mlr3} with [targets](https://docs.ropensci.org/targets/) for reproducible ML workflow automation.
* [List of extension packages](https://mlr-org.com/ecosystem.html)
* [mlr-outreach](https://github.com/mlr-org/mlr-outreach) contains public talks and slides resources.
* [Wiki](https://github.com/mlr-org/mlr3/wiki):
  Contains mainly information for developers.

## Installation

Install the last release from CRAN:

```{r eval = FALSE}
install.packages("mlr3")
```

Install the development version from GitHub:

```{r eval = FALSE}
# install.packages("pak")
pak::pak("mlr-org/mlr3")
```

If you want to get started with `mlr3`, we recommend installing the [mlr3verse](https://mlr3verse.mlr-org.com/) meta-package which installs `mlr3` and some of the most important extension packages:
```{r eval = FALSE}
install.packages("mlr3verse")
```

## Example

### Constructing Learners and Tasks

```{r}
library(mlr3)

# create learning task
task_penguins = as_task_classif(species ~ ., data = palmerpenguins::penguins)
task_penguins

# load learner and set hyperparameter
learner = lrn("classif.rpart", cp = .01)
```

### Basic train + predict

```{r}
# train/test split
split = partition(task_penguins, ratio = 0.67)

# train the model
learner$train(task_penguins, split$train_set)

# predict data
prediction = learner$predict(task_penguins, split$test_set)

# calculate performance
prediction$confusion
measure = msr("classif.acc")
prediction$score(measure)
```

### Resample

```{r}
# 3-fold cross validation
resampling = rsmp("cv", folds = 3L)

# run experiments
rr = resample(task_penguins, learner, resampling)

# access results
rr$score(measure)[, .(task_id, learner_id, iteration, classif.acc)]
rr$aggregate(measure)
```

## Extension Packages



Consult the [wiki](https://github.com/mlr-org/mlr3/wiki/Extension-Packages) for short descriptions and links to the respective repositories.

For beginners, we strongly recommend to install and load the [mlr3verse](https://mlr3verse.mlr-org.com/) package for a better user experience.

## Why a rewrite?

[mlr](https://github.com/mlr-org/mlr) was first released to [CRAN](https://cran.r-project.org/package=mlr) in 2013.
Its core design and architecture date back even further.
The addition of many features has led to a [feature creep](https://en.wikipedia.org/wiki/Feature_creep) which makes [mlr](https://github.com/mlr-org/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](https://github.com/mlr-org/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](https://adv-r.hadley.nz/s3.html) with the help of [R6](https://cran.r-project.org/package=R6).
* Embrace [R6](https://cran.r-project.org/package=R6) for a clean OO-design, object state-changes and reference semantics. This might be less "traditional R", but seems to fit `mlr` nicely.
* Embrace [`data.table`](https://cran.r-project.org/package=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.
* Defensive programming and type safety.
  All user input is checked with [`checkmate`](https://cran.r-project.org/package=checkmate).
  Return types are documented, and mechanisms popular in base R which "simplify" the result unpredictably (e.g., `sapply()` or `drop` argument in `[.data.frame`) are avoided.
* Be light on dependencies. `mlr3` requires the following packages at runtime:
    - [`parallelly`](https://cran.r-project.org/package=parallelly):
      Helper functions for parallelization.
      No extra recursive dependencies.
    - [`future.apply`](https://cran.r-project.org/package=future.apply):
      Resampling and benchmarking is parallelized with the [`future`](https://cran.r-project.org/package=future) abstraction interfacing many parallel backends.
    - [`backports`](https://cran.r-project.org/package=backports):
      Ensures backward compatibility with older R releases. Developed by members of the `mlr` team.
      No recursive dependencies.
    - [`checkmate`](https://cran.r-project.org/package=checkmate):
      Fast argument checks. Developed by members of the `mlr` team.
      No extra recursive dependencies.
    - [`mlr3misc`](https://cran.r-project.org/package=mlr3misc):
      Miscellaneous functions used in multiple mlr3 [extension packages](https://mlr-org.com/ecosystem.html).
      Developed by the `mlr` team.
    - [`paradox`](https://cran.r-project.org/package=paradox):
      Descriptions for parameters and parameter sets. Developed by the `mlr` team.
      No extra recursive dependencies.
    - [`R6`](https://cran.r-project.org/package=R6):
      Reference class objects.
      No recursive dependencies.
    - [`data.table`](https://cran.r-project.org/package=data.table):
      Extension of R's `data.frame`.
      No recursive dependencies.
    - [`digest`](https://cran.r-project.org/package=digest) (via `mlr3misc`):
      Hash digests.
      No recursive dependencies.
    - [`uuid`](https://cran.r-project.org/package=uuid):
      Create unique string identifiers.
      No recursive dependencies.
    - [`lgr`](https://cran.r-project.org/package=lgr):
      Logging facility.
      No extra recursive dependencies.
    - [`mlr3measures`](https://cran.r-project.org/package=mlr3measures):
      Performance measures.
      No extra recursive dependencies.
    - [`mlbench`](https://cran.r-project.org/package=mlbench):
      A collection of machine learning data sets.
      No dependencies.
    - [`palmerpenguins`](https://cran.r-project.org/package=palmerpenguins):
      A classification data set about penguins, used on examples and provided as a
      toy task.  No dependencies.
* [Reflections](https://en.wikipedia.org/wiki/Reflection_%28computer_programming%29): Objects are queryable for properties and capabilities, allowing you to program on them.
* Additional functionality that comes with extra dependencies:
    - To capture output, warnings and exceptions, [`evaluate`](https://cran.r-project.org/package=evaluate) and [`callr`](https://cran.r-project.org/package=callr) can be used.

## Contributing to mlr3

This R package is licensed under the [LGPL-3](https://www.gnu.org/licenses/lgpl-3.0.en.html).
If you encounter problems using this software (lack of documentation, misleading or wrong documentation, unexpected behavior, bugs, ...) or just want to suggest features, please open an issue in the [issue tracker](https://github.com/mlr-org/mlr3/issues).
Pull requests are welcome and will be included at the discretion of the maintainers.

Please consult the [wiki](https://github.com/mlr-org/mlr3/wiki/) for a [style guide](https://github.com/mlr-org/mlr3/wiki/Style-Guide), a [roxygen guide](https://github.com/mlr-org/mlr3/wiki/Roxygen-Guide) and a [pull request guide](https://github.com/mlr-org/mlr3/wiki/PR-Guidelines).

## Citing mlr3

If you use mlr3, please cite our [JOSS article](https://doi.org/10.21105/joss.01903):
```{r echo = FALSE, comment = ""}
toBibtex(citation("mlr3"))
```

Owner

  • Name: mlr-org
  • Login: mlr-org
  • Kind: organization
  • Location: Munich, Germany

JOSS Publication

mlr3: A modern object-oriented machine learning framework in R
Published
December 11, 2019
Volume 4, Issue 44, Page 1903
Authors
Michel Lang ORCID
TU Dortmund University, LMU Munich
Martin Binder
LMU Munich
Jakob Richter ORCID
TU Dortmund University
Patrick Schratz ORCID
LMU Munich
Florian Pfisterer ORCID
LMU Munich
Stefan Coors ORCID
LMU Munich
Quay Au ORCID
LMU Munich
Giuseppe Casalicchio ORCID
LMU Munich
Lars Kotthoff ORCID
University of Wyoming
Bernd Bischl ORCID
LMU Munich
Editor
Yuan Tang ORCID
Tags
machine learning classification regression

GitHub Events

Total
  • Create event: 93
  • Release event: 5
  • Issues event: 141
  • Watch event: 90
  • Delete event: 85
  • Issue comment event: 244
  • Push event: 464
  • Pull request review event: 88
  • Pull request review comment event: 89
  • Gollum event: 6
  • Pull request event: 181
  • Fork event: 8
Last Year
  • Create event: 93
  • Release event: 5
  • Issues event: 141
  • Watch event: 91
  • Delete event: 85
  • Issue comment event: 244
  • Push event: 464
  • Pull request review event: 88
  • Pull request review comment event: 89
  • Gollum event: 6
  • Pull request event: 181
  • Fork event: 8

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 2,056
  • Total Committers: 30
  • Avg Commits per committer: 68.533
  • Development Distribution Score (DDS): 0.241
Past Year
  • Commits: 189
  • Committers: 13
  • Avg Commits per committer: 14.538
  • Development Distribution Score (DDS): 0.434
Top Committers
Name Email Commits
Michel Lang m****g@g****m 1,560
Marc Becker 3****c 171
pat-s p****z@g****m 113
Sebastian Fischer s****r@g****m 71
Maximilian Mücke m****n@g****m 21
Bernd Bischl b****l@g****t 15
GitHub n****y@g****m 15
Jakob Richter c****e@j****e 13
mb706 m****6 11
Marvin Böcker m****r@t****e 10
Coorsaa s****s@g****t 10
dependabot[bot] 4****] 9
Lona 1****k 5
Quay q****u@g****m 4
Raphael Sonabend r****5@u****k 3
Giuseppe Casalicchio g****o@s****e 3
John Zobolas b****n 3
Lennart Schneider l****h@w****e 3
Florian p****l 2
Lukas Burk j****2 2
Raphael Sonabend r****d@g****m 2
Toby Dylan Hocking t****g@r****g 2
Andreas Bender b****R@g****m 1
AnnaNzrv 6****v 1
Darío Hereñú m****a@g****m 1
Hadley Wickham h****y@p****o 1
Keno M. 1****r 1
Michael Chirico m****4@g****m 1
Tobias Pielok t****k@t****e 1
Zygmunt Zawadzki z****t@z****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 265
  • Total pull requests: 455
  • Average time to close issues: 9 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 76
  • Total pull request authors: 17
  • Average comments per issue: 1.65
  • Average comments per pull request: 0.48
  • Merged pull requests: 350
  • Bot issues: 0
  • Bot pull requests: 20
Past Year
  • Issues: 88
  • Pull requests: 211
  • Average time to close issues: 21 days
  • Average time to close pull requests: 7 days
  • Issue authors: 30
  • Pull request authors: 12
  • Average comments per issue: 0.86
  • Average comments per pull request: 0.31
  • Merged pull requests: 161
  • Bot issues: 0
  • Bot pull requests: 15
Top Authors
Issue Authors
  • sebffischer (62)
  • berndbischl (33)
  • be-marc (27)
  • mb706 (26)
  • mllg (10)
  • tdhock (8)
  • MislavSag (6)
  • pfistfl (6)
  • advieser (4)
  • bblodfon (3)
  • larskotthoff (3)
  • invain1218 (3)
  • trafficfan (3)
  • RaphaelS1 (3)
  • slecee (2)
Pull Request Authors
  • be-marc (189)
  • sebffischer (108)
  • mllg (47)
  • m-muecke (40)
  • dependabot[bot] (20)
  • berndbischl (12)
  • mb706 (8)
  • lona-k (7)
  • bblodfon (5)
  • tdhock (4)
  • jemus42 (3)
  • pat-s (3)
  • AnnaNzrv (2)
  • camsique (2)
  • RaphaelS1 (2)
Top Labels
Issue Labels
Workshop (52) Type: Enhancement (24) Type: Bug (12) Status: Discussion Needed (9) Priority: Low (8) Priority: Medium (7) Status: Available (7) Type: Documentation (6) Type: Maintenance (2) workshop (2) Type: Optimizaton (2) Priority: High (2) Status: Completed (1) Status: Pending (1) Status: Accepted (1) Status: Review Needed (1) Weights (1) Good First Issue (1) Status: In Progress (1)
Pull Request Labels
dependencies (20) Status: Accepted (3) github_actions (3) Workshop (2)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 9,663 last-month
  • Total docker downloads: 42,559
  • Total dependent packages: 47
    (may contain duplicates)
  • Total dependent repositories: 76
    (may contain duplicates)
  • Total versions: 83
  • Total maintainers: 1
cran.r-project.org: mlr3

Machine Learning in R - Next Generation

  • Versions: 39
  • Dependent Packages: 47
  • Dependent Repositories: 76
  • Downloads: 9,663 Last month
  • Docker Downloads: 42,559
Rankings
Stargazers count: 0.3%
Forks count: 0.8%
Dependent packages count: 1.8%
Dependent repos count: 2.7%
Downloads: 4.6%
Average: 5.5%
Docker downloads count: 22.7%
Maintainers (1)
Last synced: about 1 year ago
proxy.golang.org: github.com/mlr-org/mlr3
  • Versions: 44
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.0%
Average: 9.6%
Dependent repos count: 10.2%
Last synced: 4 months ago

Dependencies

.github/workflows/pkgdown.yml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/r-cmd-check.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.1.0 depends
  • R6 >= 2.4.1 imports
  • backports * imports
  • checkmate >= 2.0.0 imports
  • data.table >= 1.14.2 imports
  • evaluate * imports
  • future * imports
  • future.apply >= 1.5.0 imports
  • lgr >= 0.3.4 imports
  • mlbench * imports
  • mlr3measures >= 0.4.1 imports
  • mlr3misc >= 0.12.0 imports
  • palmerpenguins * imports
  • paradox >= 0.10.0 imports
  • parallelly * imports
  • uuid * imports
  • Matrix * suggests
  • callr * suggests
  • codetools * suggests
  • datasets * suggests
  • future.callr * suggests
  • mlr3data * suggests
  • progressr * suggests
  • remotes * suggests
  • rpart * suggests
  • testthat >= 3.1.0 suggests