Skip to contents

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

Dictionary

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

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

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin

Parameters

IdTypeDefaultLevelsRange
ntreeinteger500\([1, \infty)\)
replacelogicalFALSETRUE, FALSE-
fractionnumeric0.632\([0, 1]\)
mtryinteger-\([0, \infty)\)
mtryrationumeric-\([0, 1]\)
applyfununtyped--
coresintegerNULL\((-\infty, \infty)\)
tracelogicalFALSETRUE, FALSE-
offsetuntyped--
clusteruntyped--
scoresuntyped--
teststatcharacterquadraticquadratic, maximum-
splitstatcharacterquadraticquadratic, maximum-
splittestlogicalFALSETRUE, FALSE-
testtypecharacterUnivariateBonferroni, MonteCarlo, Univariate, Teststatistic-
nmaxuntyped--
pargsuntyped--
alphanumeric0.05\([0, 1]\)
mincriterionnumeric0\([0, 1]\)
logmincriterionnumeric0\((-\infty, \infty)\)
minsplitinteger20\([1, \infty)\)
minbucketinteger7\([1, \infty)\)
minprobnumeric0.01\([0, 1]\)
stumplogicalFALSETRUE, FALSE-
lookaheadlogicalFALSETRUE, FALSE-
MIAlogicalFALSETRUE, FALSE-
nresampleinteger9999\([1, \infty)\)
tolnumeric1.490116e-08\([0, \infty)\)
maxsurrogateinteger0\([0, \infty)\)
numsurrogatelogicalFALSETRUE, FALSE-
maxdepthintegerInf\([0, \infty)\)
multiwaylogicalFALSETRUE, FALSE-
splittryinteger2\([0, \infty)\)
intersplitlogicalFALSETRUE, FALSE-
majoritylogicalFALSETRUE, FALSE-
caseweightslogicalTRUETRUE, FALSE-
saveinfologicalFALSETRUE, FALSE-
updatelogicalFALSETRUE, FALSE-
splitflavourcharacterctreectree, exhaustive-
maxvarinteger-\([1, \infty)\)
OOBlogicalFALSETRUE, FALSE-
simplifylogicalTRUETRUE, FALSE-
scalelogicalTRUETRUE, FALSE-
nperminteger1\([0, \infty)\)
riskcharacterloglikloglik, misclassification-
conditionallogicalFALSETRUE, FALSE-
thresholdnumeric0.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.

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. doi:10.1198/106186006x133933 , https://doi.org/10.1198/106186006x133933.

See also

Author

sumny

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifCForest

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method oob_error()

The importance scores are calculated using partykit::varimp().

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

Usage

LearnerClassifCForest$oob_error()

Returns

numeric(1).


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifCForest$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

learner = mlr3::lrn("classif.cforest")
print(learner)
#> <LearnerClassifCForest:classif.cforest>: Conditional Random Forest
#> * Model: -
#> * Parameters: teststat=quadratic, testtype=Univariate, mincriterion=0,
#>   saveinfo=FALSE
#> * Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
#> * Predict Types:  [response], prob
#> * Feature Types: integer, numeric, factor, ordered
#> * Properties: multiclass, oob_error, twoclass, weights

# available parameters:
learner$param_set$ids()
#>  [1] "ntree"           "replace"         "fraction"        "mtry"           
#>  [5] "mtryratio"       "applyfun"        "cores"           "trace"          
#>  [9] "offset"          "cluster"         "scores"          "teststat"       
#> [13] "splitstat"       "splittest"       "testtype"        "nmax"           
#> [17] "pargs"           "alpha"           "mincriterion"    "logmincriterion"
#> [21] "minsplit"        "minbucket"       "minprob"         "stump"          
#> [25] "lookahead"       "MIA"             "nresample"       "tol"            
#> [29] "maxsurrogate"    "numsurrogate"    "maxdepth"        "multiway"       
#> [33] "splittry"        "intersplit"      "majority"        "caseweights"    
#> [37] "saveinfo"        "update"          "splitflavour"    "maxvar"         
#> [41] "OOB"             "simplify"        "scale"           "nperm"          
#> [45] "risk"            "conditional"     "threshold"