Learn R Programming

mlr (version 2.10)

getTaskTargets: Get target data of task.

Description

Get target data of task.

Usage

getTaskTargets(task, recode.target = "no")

Arguments

task
[Task] The task.
recode.target
[character(1)] Should target classes be recoded? Only for binary classification. Possible are “no” (do nothing), “01”, and “-1+1”. In the two latter cases the target vector is converted into a numeric vector. The positive class is coded as +1 and the negative class either as 0 or -1. Default is “no”.

Value

A factor for classification or a numeric for regression, a data.frame of logical columns for multilabel.

See Also

Other task: getTaskClassLevels, getTaskCosts, getTaskData, getTaskDescription, getTaskFeatureNames, getTaskFormula, getTaskId, getTaskNFeats, getTaskSize, getTaskTargetNames, getTaskType, subsetTask

Examples

Run this code
task = makeClassifTask(data = iris, target = "Species")
getTaskTargets(task)

Run the code above in your browser using DataLab