| make.classif.task(mlr) | R Documentation |
make.classif.task defines a classification task for a learner and a data set and is the starting point
for further steps like training, predicting new data, resampling and tuning.
make.classif.task(learner, formula, data, weights, type)
learner |
[character] Specifies the learner. See the list below in the details section. |
formula |
[formula] A symbolic description of the model to be fitted. |
data |
[data.frame] A data frame containing the variables in the model. |
weights |
[numeric] An optional vector of weights to be used in the fitting process. Default is a weight of 1 for every case. |
type |
[character] Specifies the type of the predictions - either probabilities ("prob") or classes ("class"). Default is "class". |
make.classif.task already performs quite a few tasks: It tries to load the required package for the
learner, sets up the learner to deal with a classification problem, gathers information about the features
of the data set and the method, and compares whether they are compatible
(e.g. some methods might not handle NAs or factors). And last but not least it might perform some data conversions
in the data.frame, like coverting integer features to numerics or integer classes to factors, but will generally
warn about this.
List of supported learning algorithms. The naming conventions are to add the package name as a prefix if a learner is implemented in different packages and the suffix ".classif" if it can handle more than a classification task.
adaboostkknn.classifldalogregmdanaiveBayesqdarandomForest.classifrdarpart.classifkernlab.svm.classif
An object of class classif.task.
wrapped.learner, classif.task, train, predict
data(iris)
# define a classification task for a decision tree (rpart) for the data set iris
ct <- make.classif.task("rpart.classif", data = iris, formula = Species ~.)