Learn R Programming

mlr (version 1.1-18)

makeClassifTask: Create a classification / regression task for a given data set.

Description

The task encapsulates the data and specifies - through its subclasses - the type of the task (either classification or regression), and contains a description object detailing further aspects of the data.

Usage

makeClassifTask(id, data, target, blocking, positive,
    check.data = TRUE)

makeRegrTask(id, data, target, blocking, check.data = TRUE)

Arguments

Value

[SupervisedTask].

Details

Useful operators are: getTaskFormula, getTaskFormulaAsString, getTaskFeatureNames, getTaskData, getTaskTargets, subsetTask.

Object members: [object Object],[object Object],[object Object]

Examples

Run this code
library(mlbench)
data(BostonHousing)
RegrTask <- makeRegrTask(data = BostonHousing, target = "medv")

ClassifTask <- makeClassifTask(data = iris, target = "Species")

## an example of a classification task with more than those standard arguments:
library(mlbench)
data(Ionosphere)
blocks <- factor(c(rep(1, 51), rep(2, 300)))
ClassifTask <- makeClassifTask(id = "myIonosphere", data = Ionosphere, target = "Class",
                               positive = "good", blocking = blocks)

Run the code above in your browser using DataLab