mlr_learners_regr.cforest: Regression Conditional Random Forest Learner

mlr_learners_regr.cforestR Documentation

Regression Conditional Random Forest Learner

Description

A random forest based on conditional inference trees (ctree). Calls partykit::cforest() from partykit.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.cforest")

Meta Information

Parameters

Id Type Default Levels Range
ntree integer 500 [1, \infty)
replace logical FALSE TRUE, FALSE -
fraction numeric 0.632 [0, 1]
mtry integer - [0, \infty)
mtryratio numeric - [0, 1]
applyfun untyped - -
cores integer NULL (-\infty, \infty)
trace logical FALSE TRUE, FALSE -
offset untyped - -
cluster untyped - -
scores untyped - -
teststat character quadratic quadratic, maximum -
splitstat character quadratic quadratic, maximum -
splittest logical FALSE TRUE, FALSE -
testtype character Univariate Bonferroni, MonteCarlo, Univariate, Teststatistic -
nmax untyped - -
pargs untyped - -
alpha numeric 0.05 [0, 1]
mincriterion numeric 0 [0, 1]
logmincriterion numeric 0 (-\infty, \infty)
minsplit integer 20 [1, \infty)
minbucket integer 7 [1, \infty)
minprob numeric 0.01 [0, 1]
stump logical FALSE TRUE, FALSE -
lookahead logical FALSE TRUE, FALSE -
MIA logical FALSE TRUE, FALSE -
maxvar integer - [1, \infty)
nresample integer 9999 [1, \infty)
tol numeric 1.490116e-08 [0, \infty)
maxsurrogate integer 0 [0, \infty)
numsurrogate logical FALSE TRUE, FALSE -
maxdepth integer Inf [0, \infty)
multiway logical FALSE TRUE, FALSE -
splittry integer 2 [0, \infty)
intersplit logical FALSE TRUE, FALSE -
majority logical FALSE TRUE, FALSE -
caseweights logical TRUE TRUE, FALSE -
saveinfo logical FALSE TRUE, FALSE -
update logical FALSE TRUE, FALSE -
splitflavour character ctree ctree, exhaustive -
OOB logical FALSE TRUE, FALSE -
simplify logical TRUE TRUE, FALSE -
scale logical TRUE TRUE, FALSE -
nperm integer 1 [0, \infty)
risk character loglik loglik, misclassification -
conditional logical FALSE TRUE, FALSE -
threshold numeric 0.2 (-\infty, \infty)

Custom mlr3 parameters

  • mtry:

    • This hyperparameter can alternatively be set via the added hyperparameter mtryratio as mtry = max(ceiling(mtryratio * n_features), 1). Note that mtry and mtryratio are mutually exclusive.

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCForest

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerRegrCForest$new()

Method oob_error()

The out-of-bag error, calculated using the OOB predictions from partykit.

Usage
LearnerRegrCForest$oob_error()
Returns

numeric(1).


Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerRegrCForest$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

sumny

References

Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.

Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/106186006x133933")}, https://doi.org/10.1198/106186006x133933.

See Also

Examples


# Define the Learner
learner = mlr3::lrn("regr.cforest")
print(learner)

# Define a Task
task = mlr3::tsk("mtcars")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()


mlr-org/mlr3extralearners documentation built on Nov. 11, 2024, 11:11 a.m.