# mlr Tutorial

This web page provides an in-depth introduction on how to use the mlr framework for machine learning experiments in R.

We focus on the comprehension of the basic functions and applications. More detailed technical information can be found in the manual pages which are regularly updated and reflect the documentation of the current package version on CRAN.

• here for the current mlr release on CRAN
• and here for the mlr devel version on Github.

The tutorial explains the basic analysis of a data set step by step. Please refer to sections of the menu above: Basics, Advanced, Extend and Appendix.

During the tutorial we present various simple examples from classification, regression, cluster and survival analysis to illustrate the main features of the package.

## Quick start

A simple stratified cross-validation of linear discriminant analysis with mlr.

library(mlr)
data(iris)

## Define the learner
lrn = makeLearner("classif.lda")

## Define the resampling strategy
rdesc = makeResampleDesc(method = "CV", stratify = TRUE)

## Do the resampling
r = resample(learner = lrn, task = task, resampling = rdesc, show.info = FALSE)

## Get the mean misclassification error
r\$aggr
#> mmce.test.mean
#>           0.02