R/ClassifTask.R, R/ClusterTask.R, R/CostSensTask.R, and 5 more
The task encapsulates the data and specifies - through its subclasses - the type of the task. It also contains a description object detailing further aspects of the data.
Useful operators are: getTaskFormula, getTaskFeatureNames, getTaskData, getTaskTargets, and subsetTask.
Object members:
environment)Environment where data for the task are stored. Use getTaskData in order to access it.
See argument. NULL if not present.
See argument. NULL if not present.
Encapsulates further information about the task.
makeClassifTask(id = deparse(substitute(data)), data, target, weights = NULL, blocking = NULL, coordinates = NULL, positive = NA_character_, fixup.data = "warn", check.data = TRUE) makeClusterTask(id = deparse(substitute(data)), data, weights = NULL, blocking = NULL, coordinates = NULL, fixup.data = "warn", check.data = TRUE) makeCostSensTask(id = deparse(substitute(data)), data, costs, blocking = NULL, coordinates = NULL, fixup.data = "warn", check.data = TRUE) makeMultilabelTask(id = deparse(substitute(data)), data, target, weights = NULL, blocking = NULL, coordinates = NULL, fixup.data = "warn", check.data = TRUE) makeRegrTask(id = deparse(substitute(data)), data, target, weights = NULL, blocking = NULL, coordinates = NULL, fixup.data = "warn", check.data = TRUE) makeSurvTask(id = deparse(substitute(data)), data, target, weights = NULL, blocking = NULL, coordinates = NULL, fixup.data = "warn", check.data = TRUE)
| id | ( |
|---|---|
| data | (data.frame) |
| target | ( |
| weights | (numeric) |
| blocking | (factor) |
| coordinates | (data.frame) |
| positive | ( |
| fixup.data | ( |
| check.data | ( |
| costs | (data.frame) |
(Task).
For multilabel classification we assume that the presence of labels is encoded via logical
columns in data. The name of the column specifies the name of the label. target
is then a char vector that points to these columns.
Functional data can be added to a task via matrix columns. For more information refer to makeFunctionalData.
Other costsens: makeCostSensClassifWrapper,
makeCostSensRegrWrapper,
makeCostSensWeightedPairsWrapper
if (requireNamespace("mlbench")) { library(mlbench) data(BostonHousing) data(Ionosphere) makeClassifTask(data = iris, target = "Species") makeRegrTask(data = BostonHousing, target = "medv") # an example of a classification task with more than those standard arguments: blocking = factor(c(rep(1, 51), rep(2, 300))) makeClassifTask(id = "myIonosphere", data = Ionosphere, target = "Class", positive = "good", blocking = blocking) makeClusterTask(data = iris[, -5L]) }#>#> Unsupervised task: iris[, -5L] #> Type: cluster #> Observations: 150 #> Features: #> numerics factors ordered functionals #> 4 0 0 0 #> Missings: FALSE #> Has weights: FALSE #> Has blocking: FALSE #> Has coordinates: FALSE