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


Method new()

Creates a new instance of this R6 class.


Method oob_error()

OOB concordance error extracted from the model slot eval_oobag$stat_values

Usage

LearnerClassifObliqueRandomForest$oob_error()

Returns

numeric().


Method importance()

The importance scores are extracted from the model.

Usage

LearnerClassifObliqueRandomForest$importance()

Returns

Named numeric().


Method 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.588
#> Min observations in leaf: 5
#>           OOB stat value: 0.89
#>            OOB stat type: AUC-ROC
#>      Variable importance: anova
#> 
#> -----------------------------------------
print(learner$importance())
#>        V12        V11        V13        V10        V48         V9        V46 
#> 0.47511312 0.44782609 0.30526316 0.27802691 0.27053140 0.26146789 0.24537037 
#>        V36        V47        V43        V49        V51        V22        V45 
#> 0.23880597 0.23834197 0.23626374 0.23041475 0.22935780 0.21000000 0.20434783 
#>        V35         V1        V16        V52         V2        V44        V21 
#> 0.19909502 0.19248826 0.16915423 0.16826923 0.16239316 0.16203704 0.15226337 
#>        V17         V4        V37        V15        V23         V8        V34 
#> 0.15000000 0.14356436 0.14150943 0.14070352 0.12440191 0.09905660 0.09174312 
#>         V5        V38        V20        V24        V18        V50        V33 
#> 0.08962264 0.08612440 0.07978723 0.07964602 0.07555556 0.07476636 0.07407407 
#>        V14        V25        V53        V59        V19        V28        V42 
#> 0.07386364 0.07368421 0.06763285 0.06250000 0.06030151 0.05911330 0.05825243 
#>        V29         V7        V31        V57        V40         V3         V6 
#> 0.05769231 0.05729167 0.05392157 0.05365854 0.04838710 0.04716981 0.04591837 
#>        V26        V39        V41        V30        V32        V27        V58 
#> 0.04188482 0.04000000 0.03781513 0.03720930 0.03500000 0.03056769 0.02955665 
#>        V60        V55        V56        V54 
#> 0.02392344 0.01604278 0.01315789 0.00000000 

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

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