Skip to contents

Accelerated oblique random regression 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("regr.aorsf")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • 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_typecharactermeannone, leaf, mean-
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_rulecharactervariancevariance-
target_dfintegerNULL\([1, \infty)\)
tree_seedsintegerNULL\([1, \infty)\)
verbose_progresslogicalFALSETRUE, FALSE-

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrObliqueRandomForest

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

LearnerRegrObliqueRandomForest$oob_error()

Returns

numeric().


Method importance()

The importance scores are extracted from the model.

Usage

LearnerRegrObliqueRandomForest$importance()

Returns

Named numeric().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrObliqueRandomForest$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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

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

# 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 regression forest
#> 
#>      Linear combinations: Linear regression
#>           N observations: 21
#>                  N trees: 500
#>       N predictors total: 10
#>    N predictors per node: 4
#>  Average leaves per tree: 3.256
#> Min observations in leaf: 5
#>           OOB stat value: 0.68
#>            OOB stat type: RSQ
#>      Variable importance: anova
#> 
#> -----------------------------------------
print(learner$importance())
#>        cyl       disp         wt         hp       qsec       gear       carb 
#> 0.14150943 0.10826211 0.08791209 0.05934718 0.05769231 0.03560831 0.03384615 
#>         vs         am       drat 
#> 0.02388060 0.02034884 0.01197605 

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

# Score the predictions
predictions$score()
#> regr.mse 
#> 13.29896