Wrapped learners

Wrapped learner classes provide a unified interface to all classification/regression methods in R. Some are already integrated, others are not, but the package is specifically designed to make extensions easy. If one of your favourite methods is missing, either send me an email or see the part of the tutorial how to extend the package yourself.

You have two options to access the learning algorithms in mlr. Either by passing the name as a character string to the appropriate method or by constructing the wrapped learner object explicitly:

Example

Let's have a look at the iris example to show the two different possibilities:

	# Classification task: 
	ct <- make.classif.task(data = iris, target = "Species")

	# First possibility: 
	#   passing the name as a character string to the appropriate method: 
	model <- train("lda", ct)

	# Second possibility: 
	#   constructing the wrapped learner object explicitly 
	wl <- make.learner("lda")

	#   and set technical parameter: 
	wl <- set.train.par(wl, tol = 10^-5)
	model <- train(wl, ct)

	#   Let's see what wl is: 
	wl
	
	  
	Classification learner LDA from package MASS

	Supports multiclass: TRUE
	Supported features Nums:TRUE Factors:TRUE Chars:FALSE
	Supports missings: FALSE
	Supports probabilities: TRUE
	Supports weights: FALSE
	Supports costs: FALSE
	

As you can see above, the wrapped learner includes a lot of information about the supported or not supported cases of the specific learner. For example, the LDA supports multiclass but cannot handle missings. In this way you get an overview, whether the possibilities of the chosen learner go with your data or not.

Every method in mlr which has a learning algorithm as an argument will allow both variants. The latter one allows more flexibility when you want to change default parameters or add something more complex on top of the learning algorithm (e.g. see Tuning).

To see which learners are already implemented have a look at the R documentation of make.learner ---Link geht nicht----.