https://github.com/mlr-org/mlr3extralearners
Extra learners for use in mlr3.
https://github.com/mlr-org/mlr3extralearners
machine-learning mlr3 r r-package
Last synced: 3 months ago
JSON representation
Extra learners for use in mlr3.
- Host: GitHub
- URL: https://github.com/mlr-org/mlr3extralearners
- Owner: mlr-org
- License: lgpl-3.0
- Created: 2020-08-10T10:37:48.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2026-04-01T12:12:30.000Z (3 months ago)
- Last Synced: 2026-04-01T14:31:41.331Z (3 months ago)
- Topics: machine-learning, mlr3, r, r-package
- Language: R
- Homepage: https://mlr3extralearners.mlr-org.com/
- Size: 383 MB
- Stars: 114
- Watchers: 4
- Forks: 59
- Open Issues: 27
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
cache = FALSE,
collapse = TRUE,
comment = "#>",
echo = TRUE
)
library(mlr3extralearners)
library(magrittr)
```
# mlr3extralearners
Package website: [release](https://mlr3extralearners.mlr-org.com/) \|
[dev](https://mlr3extralearners.mlr-org.com/dev/)
Extra Learners for **[mlr3](https://github.com/mlr-org/mlr3/)**.
[](https://github.com/mlr-org/mlr3extralearners/actions/workflows/rcmdcheck.yml)
[](https://stackoverflow.com/questions/tagged/mlr3)
[](https://lmmisld-lmu-stats-slds.srv.mwn.de/mlr_invite/)
[](https://doi.org/10.21105/joss.08331)
## What is mlr3extralearners?
`mlr3extralearners` contains all learners from mlr3 that are not in `mlr3learners` or the core packages.
An overview of all learners within the `mlr3verse` can be found [here](https://mlr-org.com/learners.html).
`mlr3extralearners` lives on GitHub and will not be on CRAN.
You can install the package as follows:
```{r, eval = FALSE}
# latest GitHub release
pak::pak("mlr-org/mlr3extralearners@*release")
# development version
pak::pak("mlr-org/mlr3extralearners")
```
Alternatively, you can add the following to your .Rprofile, which allows you to install `mlr3extralearners` via `install.packages()`.
```{r, eval = FALSE}
# .Rprofile
options(repos = c(
mlrorg = "https://mlr-org.r-universe.dev",
CRAN = "https://cloud.r-project.org/"
))
```
## Quick Start
The package includes functionality for detecting if you have the required packages installed
to use a learner, and ships with the function `install_learner` which can install all required
learner dependencies.
```{r, echo=TRUE, eval = FALSE}
library(mlr3extralearners)
lrn("regr.gbm")
#> Warning: Package 'gbm' required but not installed for Learner 'regr.gbm'
#> : Gradient Boosting
#> * Model: -
#> * Parameters: keep.data=FALSE, n.cores=1
#> * Packages: mlr3, mlr3extralearners, gbm
#> * Predict Types: [response]
#> * Feature Types: integer, numeric, factor, ordered
#> * Properties: importance, missings, weights
install_learners("regr.gbm")
learner = lrn("regr.gbm")
learner
#> : Gradient Boosting
#> * Model: -
#> * Parameters: keep.data=FALSE, n.cores=1
#> * Packages: mlr3, mlr3extralearners, gbm
#> * Predict Types: [response]
#> * Feature Types: integer, numeric, factor, ordered
#> * Properties: importance, missings, weights
```
```{r, echo = FALSE}
learner = lrn("regr.gbm")
```
You can now use the learner to fit a model and make predictions.
```{r}
task = tsk("california_housing")
task
split = partition(task)
learner$train(task, split$train)
learner$predict(task, split$test)
```
You can learn more about using learners by [reading our book](https://mlr3book.mlr-org.com/chapters/chapter1/introduction_and_overview.html#mlr3-by-example).
## Extending mlr3extralearners
An in-depth tutorial on how to add learners can be found in the [package website](https://mlr3extralearners.mlr-org.com/articles/extending.html).
## Acknowledgements
This R package is developed as part of the [Mathematical Research Data Initiative](https://www.mardi4nfdi.de/about/mission).
## Citing mlr3extralearners
If you use `mlr3extralearners`, please cite our [JOSS paper](https://doi.org/10.21105/joss.08331):
```{r echo = FALSE, comment = ""}
toBibtex(citation("mlr3extralearners"))
```