Useful in trainLearner when you add a learning machine to the package.
getTaskData( task, subset = NULL, features, target.extra = FALSE, recode.target = "no", functionals.as = "dfcols" )
task | (Task) |
---|---|
subset | (integer | logical | |
features | (character | integer | logical) |
target.extra | ( |
recode.target | ( |
functionals.as | ( |
Either a data.frame or a list with data.frame data
and vector target
.
Other task:
getTaskClassLevels()
,
getTaskCosts()
,
getTaskDesc()
,
getTaskFeatureNames()
,
getTaskFormula()
,
getTaskId()
,
getTaskNFeats()
,
getTaskSize()
,
getTaskTargetNames()
,
getTaskTargets()
,
getTaskType()
,
subsetTask()
library("mlbench") data(BreastCancer) df = BreastCancer df$Id = NULL task = makeClassifTask(id = "BreastCancer", data = df, target = "Class", positive = "malignant") head(getTaskData)#> #> 1 function (task, subset = NULL, features, target.extra = FALSE, #> 2 recode.target = "no", functionals.as = "dfcols") #> 3 { #> 4 checkTask(task, "Task") #> 5 checkTaskSubset(subset, size = task$task.desc$size) #> 6 assertLogical(target.extra)#> Cell.size Cell.shape Class #> 1 1 1 -1 #> 2 4 4 -1 #> 3 1 1 -1 #> 4 8 8 -1 #> 5 1 1 -1 #> 6 10 10 1#> Cl.thickness Cell.size Cell.shape Marg.adhesion Epith.c.size Bare.nuclei #> 1 5 1 1 1 2 1 #> 2 5 4 4 5 7 10 #> 3 3 1 1 1 2 2 #> 4 6 8 8 1 3 4 #> 5 4 1 1 3 2 1 #> 6 8 10 10 8 7 10 #> Bl.cromatin Normal.nucleoli Mitoses Class #> 1 3 1 1 0 #> 2 3 2 1 0 #> 3 3 1 1 0 #> 4 3 7 1 0 #> 5 3 1 1 0 #> 6 9 7 1 1