Oblique Random Forest Classifier
mlr_learners_classif.aorsf.Rd
Accelerated oblique random classification 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::LearnerClassif
-> LearnerClassifObliqueRandomForest
Methods
Method oob_error()
OOB concordance error extracted from the model slot
eval_oobag$stat_values
Examples
# Define the Learner
learner = mlr3::lrn("classif.aorsf", importance = "anova")
print(learner)
#> <LearnerClassifObliqueRandomForest:classif.aorsf>: Oblique Random Forest Classifier
#> * Model: -
#> * Parameters: importance=anova, n_thread=1
#> * Packages: mlr3, mlr3extralearners, aorsf
#> * Predict Types: [response], prob
#> * Feature Types: integer, numeric, factor, ordered
#> * Properties: importance, multiclass, oob_error, twoclass
# Define a Task
task = mlr3::tsk("breast_cancer")
# 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 classification forest
#>
#> Linear combinations: Logistic regression
#> N observations: 458
#> N classes: 2
#> N trees: 500
#> N predictors total: 9
#> N predictors per node: 3
#> Average leaves per tree: 2.964
#> Min observations in leaf: 5
#> OOB stat value: 0.99
#> OOB stat type: AUC-ROC
#> Variable importance: anova
#>
#> -----------------------------------------
print(learner$importance())
#> bare_nuclei cl_thickness cell_shape bl_cromatin cell_size
#> 0.5716273 0.5369030 0.5317680 0.5219858 0.4333801
#> normal_nucleoli marg_adhesion epith_c_size mitoses
#> 0.4226519 0.4159544 0.3222892 0.2561728
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> classif.ce
#> 0.02666667