mlr_learners_classif.rpart: Classification Tree Learner

mlr_learners_classif.rpartR Documentation

Classification Tree Learner

Description

A LearnerClassif for a classification tree implemented in rpart::rpart() in package rpart.

Initial parameter values

  • Parameter xval is initialized to 0 in order to save some computation time.

Custom mlr3 parameters

  • Parameter model has been renamed to keep_model.

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("classif.rpart")
lrn("classif.rpart")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”

  • Required Packages: mlr3, rpart

Parameters

Id Type Default Levels Range
cp numeric 0.01 [0, 1]
keep_model logical FALSE TRUE, FALSE -
maxcompete integer 4 [0, \infty)
maxdepth integer 30 [1, 30]
maxsurrogate integer 5 [0, \infty)
minbucket integer - [1, \infty)
minsplit integer 20 [1, \infty)
surrogatestyle integer 0 [0, 1]
usesurrogate integer 2 [0, 2]
xval integer 10 [0, \infty)

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRpart

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerClassifRpart$new()

Method importance()

The importance scores are extracted from the model slot variable.importance.

Usage
LearnerClassifRpart$importance()
Returns

Named numeric().


Method selected_features()

Selected features are extracted from the model slot frame$var.

Usage
LearnerClassifRpart$selected_features()
Returns

character().


Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerClassifRpart$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

Breiman L, Friedman JH, Olshen RA, Stone CJ (1984). Classification And Regression Trees. Routledge. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/9781315139470")}.

See Also

Other Learner: Learner, LearnerClassif, LearnerRegr, mlr_learners, mlr_learners_classif.debug, mlr_learners_classif.featureless, mlr_learners_regr.debug, mlr_learners_regr.featureless, mlr_learners_regr.rpart


mlr3 documentation built on Oct. 18, 2024, 5:11 p.m.