Skip to contents

Calls partykit::cforest from package 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: mlr3extralearners, partykit, sandwich, coin

Parameters

IdTypeDefaultLevelsRange
ntreeinteger500\([1, \infty)\)
replacelogicalFALSETRUE, FALSE\((-\infty, \infty)\)
fractionnumeric0.632\([0, 1]\)
mtryinteger-\([0, \infty)\)
mtryrationumeric-\([0, 1]\)
applyfunlist-\((-\infty, \infty)\)
coresintegerNULL\((-\infty, \infty)\)
tracelogicalFALSETRUE, FALSE\((-\infty, \infty)\)
offsetlist-\((-\infty, \infty)\)
clusterlist-\((-\infty, \infty)\)
scoreslist-\((-\infty, \infty)\)
teststatcharacterquadraticquadratic, maximum\((-\infty, \infty)\)
splitstatcharacterquadraticquadratic, maximum\((-\infty, \infty)\)
splittestlogicalFALSETRUE, FALSE\((-\infty, \infty)\)
testtypecharacterUnivariateBonferroni, MonteCarlo, Univariate, Teststatistic\((-\infty, \infty)\)
nmaxlist-\((-\infty, \infty)\)
pargslist-\((-\infty, \infty)\)
alphanumeric0.05\([0, 1]\)
mincriterionnumeric0\([0, 1]\)
logmincriterionnumeric0\((-\infty, \infty)\)
minsplitinteger20\([1, \infty)\)
minbucketinteger7\([1, \infty)\)
minprobnumeric0.01\([0, 1]\)
stumplogicalFALSETRUE, FALSE\((-\infty, \infty)\)
lookaheadlogicalFALSETRUE, FALSE\((-\infty, \infty)\)
MIAlogicalFALSETRUE, FALSE\((-\infty, \infty)\)
nresampleinteger9999\([1, \infty)\)
tolnumeric1.490116e-08\([0, \infty)\)
maxsurrogateinteger0\([0, \infty)\)
numsurrogatelogicalFALSETRUE, FALSE\((-\infty, \infty)\)
maxdepthintegerInf\([0, \infty)\)
multiwaylogicalFALSETRUE, FALSE\((-\infty, \infty)\)
splittryinteger2\([0, \infty)\)
intersplitlogicalFALSETRUE, FALSE\((-\infty, \infty)\)
majoritylogicalFALSETRUE, FALSE\((-\infty, \infty)\)
caseweightslogicalTRUETRUE, FALSE\((-\infty, \infty)\)
saveinfologicalFALSETRUE, FALSE\((-\infty, \infty)\)
updatelogicalFALSETRUE, FALSE\((-\infty, \infty)\)
splitflavourcharacterctreectree, exhaustive\((-\infty, \infty)\)
maxvarinteger-\([1, \infty)\)
OOBlogicalFALSETRUE, FALSE\((-\infty, \infty)\)
simplifylogicalTRUETRUE, FALSE\((-\infty, \infty)\)
scalelogicalTRUETRUE, FALSE\((-\infty, \infty)\)
nperminteger1\([0, \infty)\)
riskcharacterloglikloglik, misclassification\((-\infty, \infty)\)
conditionallogicalFALSETRUE, FALSE\((-\infty, \infty)\)
thresholdnumeric0.2\((-\infty, \infty)\)

Custom mlr3 defaults

  • 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

`r format_bib(c("hothorn_2015", "hothorn_2006"))

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 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

if (requireNamespace("partykit", quietly = TRUE) && requireNamespace("sandwich", quietly = TRUE) && requireNamespace("coin", quietly = TRUE)) {
  learner = mlr3::lrn("classif.cforest")
  print(learner)

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerClassifCForest:classif.cforest>
#> * Model: -
#> * Parameters: teststat=quadratic, testtype=Univariate, mincriterion=0,
#>   saveinfo=FALSE
#> * Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
#> * Predict Type: response
#> * Feature types: integer, numeric, factor, ordered
#> * Properties: multiclass, oob_error, twoclass, weights
#>  [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"