Skip to contents

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

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 = mlr3::lrn("classif.aorsf", importance = "anova")
print(learner)
#> 
#> ── <LearnerClassifObliqueRandomForest> (classif.aorsf): Oblique Random Forest Cl
#> • Model: -
#> • Parameters: importance=anova, 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, multiclass, oob_error, twoclass, and weights
#> • Other settings: use_weights = 'use'

# 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.822
#> Min observations in leaf: 5
#>           OOB stat value: 0.99
#>            OOB stat type: AUC-ROC
#>      Variable importance: anova
#> 
#> -----------------------------------------
print(learner$importance())
#>      cell_shape     bare_nuclei       cell_size    cl_thickness     bl_cromatin 
#>       0.5674487       0.5455861       0.5059524       0.4800570       0.4793651 
#>   marg_adhesion normal_nucleoli    epith_c_size         mitoses 
#>       0.4394619       0.4264920       0.3201175       0.1655405 

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

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