Oblique Random Forest Regressor
mlr_learners_regr.aorsf.Rd
Accelerated oblique random regression forest.
Calls aorsf::orsf()
from aorsf.
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
See also
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrObliqueRandomForest
Methods
Method oob_error()
OOB concordance error extracted from the model slot
eval_oobag$stat_values
Examples
# Define the Learner
learner = mlr3::lrn("regr.aorsf", importance = "anova")
print(learner)
#> <LearnerRegrObliqueRandomForest:regr.aorsf>: Oblique Random Forest Regressor
#> * Model: -
#> * Parameters: importance=anova, n_thread=1
#> * Packages: mlr3, mlr3extralearners, aorsf
#> * Predict Types: [response]
#> * Feature Types: logical, integer, numeric, factor, ordered
#> * Properties: importance, oob_error, weights
# Define a Task
task = mlr3::tsk("mtcars")
# Create train and test set
ids = mlr3::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.296
#> Min observations in leaf: 5
#> OOB stat value: 0.70
#> OOB stat type: RSQ
#> Variable importance: anova
#>
#> -----------------------------------------
print(learner$importance())
#> wt carb am hp disp cyl
#> 0.136363636 0.104225352 0.066666667 0.053908356 0.041994751 0.040880503
#> drat qsec gear vs
#> 0.027322404 0.010075567 0.002898551 0.000000000
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> regr.mse
#> 9.576405