File: getTaskTargets.Rd

package info (click to toggle)
r-cran-mlr 2.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,264 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (51 lines) | stat: -rw-r--r-- 1,908 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Task_operators.R
\name{getTaskTargets}
\alias{getTaskTargets}
\title{Get target data of task.}
\usage{
getTaskTargets(task, recode.target = "no")
}
\arguments{
\item{task}{(\link{Task})\cr
The task.}

\item{recode.target}{(\code{character(1)})\cr
Should target classes be recoded? Supported are binary and multilabel classification and survival.
Possible values for binary classification are \dQuote{01}, \dQuote{-1+1} and \dQuote{drop.levels}.
In the two latter cases the target vector is converted into a numeric vector.
The positive class is coded as \dQuote{+1} and the negative class either as \dQuote{0} or \dQuote{-1}.
\dQuote{drop.levels} will remove empty factor levels in the target column.
In the multilabel case the logical targets can be converted to factors with \dQuote{multilabel.factor}.
For survival, you may choose to recode the survival times to \dQuote{left}, \dQuote{right} or \dQuote{interval2} censored times
using \dQuote{lcens}, \dQuote{rcens} or \dQuote{icens}, respectively.
See \link[survival:Surv]{survival::Surv} for the format specification.
Default for both binary classification and survival is \dQuote{no} (do nothing).}
}
\value{
A \code{factor} for classification or a \code{numeric} for regression, a data.frame
of logical columns for multilabel.
}
\description{
Get target data of task.
}
\examples{
task = makeClassifTask(data = iris, target = "Species")
getTaskTargets(task)
}
\seealso{
Other task: 
\code{\link{getTaskClassLevels}()},
\code{\link{getTaskCosts}()},
\code{\link{getTaskData}()},
\code{\link{getTaskDesc}()},
\code{\link{getTaskFeatureNames}()},
\code{\link{getTaskFormula}()},
\code{\link{getTaskId}()},
\code{\link{getTaskNFeats}()},
\code{\link{getTaskSize}()},
\code{\link{getTaskTargetNames}()},
\code{\link{getTaskType}()},
\code{\link{subsetTask}()}
}
\concept{task}