make.regr.task(mlr)R Documentation

make.regr.task

Description

make.regr.task defines a regression task for a learner and a data set and is the starting point for further steps like training, predicting new data, resampling and tuning.

Usage

make.regr.task(learner, formula, data, weights)

Arguments

learner [character]
Specifies the learner. See the list below in the details section.
formula [formula]
A symbolic description of the model to be fitted.
data [data.frame]
A data frame containing the variables in the model.
weights [numeric]
An optional vector of weights to be used in the fitting process. Default is a weight of 1 for every case.

Details

make.regr.task already performs quite a few tasks: It tries to load required package for the learner, sets up the learner to deal with a regression problem, gathers information about the features of the data set and the method, and compares whether they are compatible (e.g. some methods might not handle NAs or factors). It also might perform some data conversions in the data.frame, like coverting integer features to numerics, but will generally warn about this.

List of supported learning algorithms. The naming conventions are to add the package name as a prefix if a learner is implemented in different packages and the suffix ".regr" if it can handle more than a regression task.

Value

An object of class regr.task.

See Also

wrapped.learner, regr.task, train, predict

Examples

library(mlbench)
data(BostonHousing)
# define a regression task for a Gradient Boosting Machine for regression for the data set BostonHousing
rt <- make.regr.task("gbm.regr", data = BostonHousing, formula = medv~.)

[Package mlr version 0.3.180 Index]