mlr3 (version 0.1.0-9000)

LearnerClassif: Classification Learner

Description

This Learner specializes Learner for classification problems.

Predefined learners can be found in the Dictionary mlr_learners.

Arguments

Format

R6::R6Class object inheriting from Learner.

Construction

l = LearnerClassif$new(id, param_set = ParamSet$new(), param_vals = list(), 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 a subset of c("response", "prob").

Fields

See Learner.

Methods

All methods of Learner, and additionally:

  • new_prediction(row_ids, truth, response = NULL, prob = NULL) (integer() | character(), factor(), factor(), matrix()) -> PredictionClassif Creates a new PredictionClassif object, after performing some basic type checks and transformations. See PredictionClassif for a description of the arguments.

See Also

Example classification learner: classif.rpart.

Other Learner: LearnerRegr, Learner, mlr_learners

Examples

Run this code
# NOT RUN {
# 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 = mlr_learners$get("classif.rpart")
print(lrn)
# }

Run the code above in your browser using DataLab