Skip to contents

Accelerated oblique random classification forest. Calls aorsf::orsf() from aorsf. Note that although the learner has the property "missing" and it can in principle deal with missing values, the behavior has to be configured using the parameter na_action.

Initial parameter values

  • n_thread: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.

  • pred_simplify has to be TRUE, otherwise response is NA in prediction

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.aorsf")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: mlr3, mlr3extralearners, aorsf

Parameters

IdTypeDefaultLevelsRange
attach_datalogicalTRUETRUE, FALSE-
epsilonnumeric1e-09\([0, \infty)\)
importancecharacteranovanone, anova, negate, permute-
importance_max_pvaluenumeric0.01\([1e-04, 0.9999]\)
leaf_min_eventsinteger1\([1, \infty)\)
leaf_min_obsinteger5\([1, \infty)\)
max_iterinteger20\([1, \infty)\)
methodcharacterglmglm, net, pca, random-
mtryintegerNULL\([1, \infty)\)
mtry_rationumeric-\([0, 1]\)
n_retryinteger3\([0, \infty)\)
n_splitinteger5\([1, \infty)\)
n_threadinteger-\([0, \infty)\)
n_treeinteger500\([1, \infty)\)
na_actioncharacterfailfail, impute_meanmode-
net_mixnumeric0.5\((-\infty, \infty)\)
oobaglogicalFALSETRUE, FALSE-
oobag_eval_everyintegerNULL\([1, \infty)\)
oobag_fununtypedNULL-
oobag_pred_typecharacterprobnone, leaf, prob, class-
pred_aggregatelogicalTRUETRUE, FALSE-
sample_fractionnumeric0.632\([0, 1]\)
sample_with_replacementlogicalTRUETRUE, FALSE-
scale_xlogicalFALSETRUE, FALSE-
split_min_eventsinteger5\([1, \infty)\)
split_min_obsinteger10\([1, \infty)\)
split_min_statnumericNULL\([0, \infty)\)
split_rulecharacterginigini, cstat-
target_dfintegerNULL\([1, \infty)\)
tree_seedsintegerNULL\([1, \infty)\)
verbose_progresslogicalFALSETRUE, FALSE-

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifObliqueRandomForest

Methods

Inherited methods


LearnerClassifObliqueRandomForest$new()

Creates a new instance of this R6 class.


LearnerClassifObliqueRandomForest$oob_error()

OOB concordance error extracted from the model slot eval_oobag$stat_values

Usage

LearnerClassifObliqueRandomForest$oob_error()

Returns

numeric().


LearnerClassifObliqueRandomForest$importance()

The importance scores are extracted from the model.

Usage

LearnerClassifObliqueRandomForest$importance()

Returns

Named numeric().


LearnerClassifObliqueRandomForest$clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifObliqueRandomForest$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.aorsf")
print(learner)
#> 
#> ── <LearnerClassifObliqueRandomForest> (classif.aorsf): Oblique Random Forest Cl
#> • Model: -
#> • Parameters: n_thread=1
#> • Packages: mlr3, mlr3extralearners, and aorsf
#> • Predict Types: [response] and prob
#> • Feature Types: integer, numeric, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: importance, missings, multiclass, oob_error, twoclass, and
#> weights
#> • Other settings: use_weights = 'use', predict_raw = 'FALSE'

# Define a Task
task = tsk("sonar")

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

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

print(learner$model)
#> ---------- Oblique random classification forest
#> 
#>      Linear combinations: Logistic regression
#>           N observations: 139
#>                N classes: 2
#>                  N trees: 500
#>       N predictors total: 60
#>    N predictors per node: 8
#>  Average leaves per tree: 4.918
#> Min observations in leaf: 5
#>           OOB stat value: 0.91
#>            OOB stat type: AUC-ROC
#>      Variable importance: anova
#> 
#> -----------------------------------------
print(learner$importance())
#>         V11         V12         V13         V36         V37         V44 
#> 0.523560209 0.501915709 0.355000000 0.354679803 0.315789474 0.291666667 
#>          V9          V4         V49         V10         V48         V45 
#> 0.240174672 0.235294118 0.231884058 0.230392157 0.217777778 0.215962441 
#>         V43          V1         V35         V52         V22         V21 
#> 0.191588785 0.183673469 0.181415929 0.165254237 0.159183673 0.142857143 
#>         V47         V16         V23         V20         V17         V59 
#> 0.136792453 0.133620690 0.131004367 0.126903553 0.120689655 0.115384615 
#>         V34         V31         V46         V54         V28         V38 
#> 0.113122172 0.103004292 0.102459016 0.100478469 0.100456621 0.098039216 
#>         V58         V30          V2         V15         V19         V39 
#> 0.097560976 0.092233010 0.090000000 0.086124402 0.079439252 0.075376884 
#>         V42         V29         V18         V24         V14         V26 
#> 0.072727273 0.072340426 0.066985646 0.066350711 0.061674009 0.059113300 
#>          V8         V51         V27         V40         V55         V25 
#> 0.058035714 0.052631579 0.050251256 0.047393365 0.044554455 0.043478261 
#>         V56         V33          V7         V41          V6         V60 
#> 0.036697248 0.033195021 0.033175355 0.030434783 0.028301887 0.026548673 
#>          V5         V32         V50         V53         V57          V3 
#> 0.025000000 0.023148148 0.022935780 0.020000000 0.014084507 0.008849558 

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

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2028986