LearnerClassif: Classification Learner

Description Format Construction Fields Methods See Also Examples

Description

This Learner specializes Learner for classification problems.

Many predefined learners can be found in the mlr3misc::Dictionary mlr_learners after loading the mlr3learners package.

Format

R6::R6Class object inheriting from Learner.

Construction

1
2
l = LearnerClassif$new(id, param_set = ParamSet$new(), predict_types = character(), feature_types = character(),
    properties = character(), data_formats = "data.table", packages = character())

For a description of the arguments, see Learner. task_type is set to "classif".

Possible values for predict_types are passed to and converted by PredictionClassif:

Additional learner properties include:

Fields

See Learner.

Methods

See Learner.

See Also

Example classification learners: classif.rpart

Other Learner: LearnerRegr, Learner, mlr_learners

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# get all classification learners from mlr_learners:
lrns = mlr_learners$mget(mlr_learners$keys("^classif"))
names(lrns)

# get a specific learner from mlr_learners:
lrn = lrn("classif.rpart")
print(lrn)

# train the learner:
task = tsk("iris")
lrn$train(task, 1:120)

# predict on new observations:
lrn$predict(task, 121:150)$confusion

mllg/mlr3 documentation built on Sept. 27, 2019, 9:38 a.m.