Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork94
mlr3: Machine Learning in R - next generation
License
mlr-org/mlr3
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Efficient, object-oriented programming on the building blocks of machinelearning. Successor ofmlr.
- We have written abook. This shouldbe the central entry point to the package.
- Themlr-org website includes for example agallery with case studies.
- Reference manual
- FAQ
- Ask questions on Stackoverflow (tag mlr3)
- Extension Learners
- Recommended core regression, classification, and survival learnersare inmlr3learners
- All others are inmlr3extralearners
- Use thelearner search to get asimple overview
- Cheatsheets
- Videos:
- Courses/Lectures
- The courseIntroduction to Machine learning(I2ML) is a free and open flippedclassroom course on the basics of machine learning.
mlr3is usedin thedemosandexercises.
- The courseIntroduction to Machine learning(I2ML) is a free and open flippedclassroom course on the basics of machine learning.
- Templates/Tutorials
- mlr3-targets: Tutorialshowcasing how to use {mlr3} withtargets for reproducible MLworkflow automation.
- List of extension packages
- mlr-outreach containspublic talks and slides resources.
- Wiki: Contains mainlyinformation for developers.
Install the last release from CRAN:
install.packages("mlr3")Install the development version from GitHub:
# install.packages("pak")pak::pak("mlr-org/mlr3")
If you want to get started withmlr3, we recommend installing themlr3verse meta-package which installsmlr3 and some of the most important extension packages:
install.packages("mlr3verse")library(mlr3)# create learning tasktask_penguins= as_task_classif(species~.,data=palmerpenguins::penguins)task_penguins
#### ── <TaskClassif> (344x8) ───────────────────────────────────────────────────────## • Target: species## • Target classes: Adelie (44%), Gentoo (36%), Chinstrap (20%)## • Properties: multiclass## • Features (7):## • int (3): body_mass_g, flipper_length_mm, year## • dbl (2): bill_depth_mm, bill_length_mm## • fct (2): island, sex# load learner and set hyperparameterlearner= lrn("classif.rpart",cp=.01)
# train/test splitsplit= partition(task_penguins,ratio=0.67)# train the modellearner$train(task_penguins,split$train_set)# predict dataprediction=learner$predict(task_penguins,split$test_set)# calculate performanceprediction$confusion
## truth## response Adelie Chinstrap Gentoo## Adelie 146 5 0## Chinstrap 6 63 1## Gentoo 0 0 123measure= msr("classif.acc")prediction$score(measure)
## classif.acc## 0.9651163# 3-fold cross validationresampling= rsmp("cv",folds=3L)# run experimentsrr= resample(task_penguins,learner,resampling)# access resultsrr$score(measure)[, .(task_id,learner_id,iteration,classif.acc)]
## task_id learner_id iteration classif.acc## 1: palmerpenguins::penguins classif.rpart 1 0.8956522## 2: palmerpenguins::penguins classif.rpart 2 0.9478261## 3: palmerpenguins::penguins classif.rpart 3 0.9649123rr$aggregate(measure)
## classif.acc## 0.9361302Consult thewiki forshort descriptions and links to the respective repositories.
For beginners, we strongly recommend to install and load themlr3verse package for a better userexperience.
mlr was first released toCRAN in 2013. Its core designand architecture date back even further. The addition of many featureshas led to afeaturecreep which makesmlr hard to maintain and hard toextend. We also think that while mlr was nicely extensible in some parts(learners, measures, etc.), other parts were less easy to extend fromthe outside. Also, many helpful R libraries did not exist at the timemlr was created, and their inclusionwould result in non-trivial API changes.
- Only the basic building blocks for machine learning are implemented inthis package.
- Focus on computation here. No visualization or other stuff. That cango in extra packages.
- Overcome the limitations of R’sS3classes with the help ofR6.
- EmbraceR6 for a cleanOO-design, object state-changes and reference semantics. This might beless “traditional R”, but seems to fit
mlrnicely. - Embrace
data.tablefor fast and convenient data frame computations. - Combine
data.tableandR6, for this we will make heavy use of listcolumns in data.tables. - Defensive programming and type safety. All user input is checked with
checkmate. Returntypes are documented, and mechanisms popular in base R which“simplify” the result unpredictably (e.g.,sapply()ordropargument in[.data.frame) are avoided. - Be light on dependencies.
mlr3requires the following packages atruntime:parallelly:Helper functions for parallelization. No extra recursivedependencies.future.apply:Resampling and benchmarking is parallelized with thefutureabstractioninterfacing many parallel backends.backports: Ensuresbackward compatibility with older R releases. Developed by membersof themlrteam. No recursive dependencies.checkmate: Fastargument checks. Developed by members of themlrteam. No extrarecursive dependencies.mlr3misc:Miscellaneous functions used in multiple mlr3extensionpackages. Developed by themlrteam.paradox:Descriptions for parameters and parameter sets. Developed by themlrteam. No extra recursive dependencies.R6: Reference classobjects. No recursive dependencies.data.table:Extension of R’sdata.frame. No recursive dependencies.digest(viamlr3misc): Hash digests. No recursive dependencies.uuid: Create uniquestring identifiers. No recursive dependencies.lgr: Logging facility.No extra recursive dependencies.mlr3measures:Performance measures. No extra recursive dependencies.mlbench: Acollection of machine learning data sets. No dependencies.palmerpenguins:A classification data set about penguins, used on examples andprovided as a toy task. No dependencies.
- Reflections:Objects are queryable for properties and capabilities, allowing you toprogram on them.
- Additional functionality that comes with extra dependencies:
This R package is licensed under theLGPL-3. If youencounter problems using this software (lack of documentation,misleading or wrong documentation, unexpected behavior, bugs, …) or justwant to suggest features, please open an issue in theissuetracker. Pull requests arewelcome and will be included at the discretion of the maintainers.
Please consult thewiki for astyle guide, aroxygen guide andapull requestguide.
If you use mlr3, please cite ourJOSSarticle:
@Article{mlr3, title = {{mlr3}: A modern object-oriented machine learning framework in {R}}, author = {Michel Lang and Martin Binder and Jakob Richter and Patrick Schratz and Florian Pfisterer and Stefan Coors and Quay Au and Giuseppe Casalicchio and Lars Kotthoff and Bernd Bischl}, journal = {Journal of Open Source Software}, year = {2019}, month = {dec}, doi = {10.21105/joss.01903}, url = {https://joss.theoj.org/papers/10.21105/joss.01903},}About
mlr3: Machine Learning in R - next generation
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
