Learn R Programming

mlr (version 1.1-18)

getTaskData: Extract data in task. Useful in trainLearner when you add a learning machine to the package.

Description

Extract data in task. Useful in trainLearner when you add a learning machine to the package.

Usage

getTaskData(task, subset, features, target.extra = FALSE,
    recode.target = "no")

Arguments

Value

Either a data.frame or a list with data.frame data and vector target.

Examples

Run this code
library("mlbench")
data(BreastCancer)

df <- BreastCancer
df$Id <- NULL
task <- makeClassifTask(id = "BreastCancer", data = df, target = "Class", positive = "malignant")
head(getTaskData)
head(getTaskData(task, features = c("Cell.size", "Cell.shape"), recode.target = "-1+1"))
head(getTaskData(task, subset = 1:100, recode.target = "01"))

Run the code above in your browser using DataLab