All Projects → mlr-org → Mlr3

mlr-org / Mlr3

Licence: lgpl-3.0
mlr3: Machine Learning in R - next generation

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Mlr3

Mlbox
MLBox is a powerful Automated Machine Learning python library.
Stars: ✭ 1,199 (+158.96%)
Mutual labels:  data-science, classification, regression
Mlr
Machine Learning in R
Stars: ✭ 1,542 (+233.05%)
Mutual labels:  data-science, classification, regression
Openml R
R package to interface with OpenML
Stars: ✭ 81 (-82.51%)
Mutual labels:  data-science, classification, regression
Machine Learning From Scratch
Succinct Machine Learning algorithm implementations from scratch in Python, solving real-world problems (Notebooks and Book). Examples of Logistic Regression, Linear Regression, Decision Trees, K-means clustering, Sentiment Analysis, Recommender Systems, Neural Networks and Reinforcement Learning.
Stars: ✭ 42 (-90.93%)
Mutual labels:  data-science, classification, regression
Pycaret
An open-source, low-code machine learning library in Python
Stars: ✭ 4,594 (+892.22%)
Mutual labels:  data-science, regression, classification
Php Ml
PHP-ML - Machine Learning library for PHP
Stars: ✭ 7,900 (+1606.26%)
Mutual labels:  data-science, classification, regression
Neuroflow
Artificial Neural Networks for Scala
Stars: ✭ 105 (-77.32%)
Mutual labels:  data-science, classification, regression
Ml
A high-level machine learning and deep learning library for the PHP language.
Stars: ✭ 1,270 (+174.3%)
Mutual labels:  data-science, classification, regression
Data Science Toolkit
Collection of stats, modeling, and data science tools in Python and R.
Stars: ✭ 169 (-63.5%)
Mutual labels:  data-science, classification, regression
Machine Learning With Python
Practice and tutorial-style notebooks covering wide variety of machine learning techniques
Stars: ✭ 2,197 (+374.51%)
Mutual labels:  data-science, classification, regression
Mlj.jl
A Julia machine learning framework
Stars: ✭ 982 (+112.1%)
Mutual labels:  data-science, classification, regression
Lightautoml
LAMA - automatic model creation framework
Stars: ✭ 196 (-57.67%)
Mutual labels:  data-science, classification, regression
Smile
Statistical Machine Intelligence & Learning Engine
Stars: ✭ 5,412 (+1068.9%)
Mutual labels:  data-science, classification, regression
Metriculous
Measure and visualize machine learning model performance without the usual boilerplate.
Stars: ✭ 71 (-84.67%)
Mutual labels:  data-science, classification, regression
Alphapy
Automated Machine Learning [AutoML] with Python, scikit-learn, Keras, XGBoost, LightGBM, and CatBoost
Stars: ✭ 564 (+21.81%)
Mutual labels:  data-science, classification, regression
Interactive machine learning
IPython widgets, interactive plots, interactive machine learning
Stars: ✭ 140 (-69.76%)
Mutual labels:  data-science, classification, regression
Uci Ml Api
Simple API for UCI Machine Learning Dataset Repository (search, download, analyze)
Stars: ✭ 190 (-58.96%)
Mutual labels:  data-science, classification, regression
Orange3
🍊 📊 💡 Orange: Interactive data analysis
Stars: ✭ 3,152 (+580.78%)
Mutual labels:  data-science, classification, regression
Food Recipe Cnn
food image to recipe with deep convolutional neural networks.
Stars: ✭ 448 (-3.24%)
Mutual labels:  data-science, classification
stg
Python/R library for feature selection in neural nets. ("Feature selection using Stochastic Gates", ICML 2020)
Stars: ✭ 47 (-89.85%)
Mutual labels:  regression, classification

mlr3

Package website: release | dev

Efficient, object-oriented programming on the building blocks of machine learning. Successor of mlr.

tic DOI CRAN Status StackOverflow Mattermost

Resources (for users and developers)

Installation

Install the last release from CRAN:

install.packages("mlr3")

Install the development version from GitHub:

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

If you want to get started with mlr3, we recommend installing the mlr3verse meta-package which installs mlr3 and some of the most important extension packages:

install.packages("mlr3verse")

Example

Constructing Learners and Tasks

library(mlr3)

# create learning task
task_penguins <- TaskClassif$new(id = "penguins", backend = palmerpenguins::penguins, target = "species")
task_penguins
## <TaskClassif:penguins> (344 x 8)
## * Target: species
## * 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 hyperparameter
learner <- lrn("classif.rpart", cp = .01)

Basic train + predict

# train/test split
train_set <- sample(task_penguins$nrow, 0.8 * task_penguins$nrow)
test_set <- setdiff(seq_len(task_penguins$nrow), train_set)

# train the model
learner$train(task_penguins, row_ids = train_set)

# predict data
prediction <- learner$predict(task_penguins, row_ids = test_set)

# calculate performance
prediction$confusion
##            truth
## response    Adelie Chinstrap Gentoo
##   Adelie        32         2      0
##   Chinstrap      1         8      0
##   Gentoo         0         3     23
measure <- msr("classif.acc")
prediction$score(measure)
## classif.acc 
##   0.9130435

Resample

# automatic resampling
resampling <- rsmp("cv", folds = 3L)
rr <- resample(task_penguins, learner, resampling)
rr$score(measure)
##                 task  task_id                   learner    learner_id
## 1: <TaskClassif[46]> penguins <LearnerClassifRpart[34]> classif.rpart
## 2: <TaskClassif[46]> penguins <LearnerClassifRpart[34]> classif.rpart
## 3: <TaskClassif[46]> penguins <LearnerClassifRpart[34]> classif.rpart
##            resampling resampling_id iteration              prediction
## 1: <ResamplingCV[19]>            cv         1 <PredictionClassif[19]>
## 2: <ResamplingCV[19]>            cv         2 <PredictionClassif[19]>
## 3: <ResamplingCV[19]>            cv         3 <PredictionClassif[19]>
##    classif.acc
## 1:   0.8956522
## 2:   0.9130435
## 3:   0.9473684
rr$aggregate(measure)
## classif.acc 
##    0.918688

Extension Packages

Consult the wiki for short descriptions and links to the respective repositories.

For beginners, we strongly recommend to install and load the mlr3verse package for a better user experience.

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 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 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. 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: Helper functions for parallelization. No extra recursive dependencies.
    • future.apply: Resampling and benchmarking is parallelized with the future abstraction interfacing many parallel backends.
    • 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.
    • uuid: Create unique string identifiers. No recursive dependencies.
    • lgr: Logging facility. No extra recursive dependencies.
    • mlr3measures: Performance measures. No extra recursive dependencies.
    • mlbench: A collection of machine learning data sets. No dependencies.
    • palmerpenguins: A classification data set about penguins, used on examples and provided as a toy task. No dependencies.
  • Reflections: 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 and callr can be used.

Contributing to mlr3

This R package is licensed under the LGPL-3. If you encounter problems using this software (lack of documentation, misleading or wrong documentation, unexpected behaviour, bugs, …) or just want to suggest features, please open an issue in the issue tracker. Pull requests are welcome and will be included at the discretion of the maintainers.

Please consult the wiki for a style guide, a roxygen guide and a pull request guide.

Citing mlr3

If you use mlr3, please cite our JOSS article:

@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},
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].