subsetTask: Subset data in task.

Description Usage Arguments Value See Also Examples

View source: R/Task_operators.R

Description

See title.

Usage

1
subsetTask(task, subset = NULL, features)

Arguments

task

(Task)
The task.

subset

(integer | logical | NULL)
Selected cases. Either a logical or an index vector. By default NULL if all observations are used.

features

(character | integer | logical)
Vector of selected inputs. You can either pass a character vector with the feature names, a vector of indices, or a logical vector.
In case of an index vector each element denotes the position of the feature name returned by getTaskFeatureNames.
Note that the target feature is always included in the resulting task, you should not pass it here. Default is to use all features.

Value

(Task). Task with subsetted data.

See Also

Other task: getTaskClassLevels, getTaskCosts, getTaskData, getTaskDesc, getTaskFeatureNames, getTaskFormula, getTaskId, getTaskNFeats, getTaskSize, getTaskTargetNames, getTaskTargets, getTaskType

Examples

1
2
task = makeClassifTask(data = iris, target = "Species")
subsetTask(task, subset = 1:100)

berndbischl/mlr documentation built on May 21, 2018, 5:45 a.m.