Classification Imbalanced Random Forest Src Learner
mlr_learners_classif.imbalanced_rfsrc.Rd
Imbalanced Random forest for classification between two classes.
Calls randomForestSRC::imbalanced.rfsrc()
from from randomForestSRC.
Custom mlr3 parameters
mtry
:This hyperparameter can alternatively be set via the added hyperparameter
mtry.ratio
asmtry = max(ceiling(mtry.ratio * n_features), 1)
. Note thatmtry
andmtry.ratio
are mutually exclusive.
sampsize
:This hyperparameter can alternatively be set via the added hyperparameter
sampsize.ratio
assampsize = max(ceiling(sampsize.ratio * n_obs), 1)
. Note thatsampsize
andsampsize.ratio
are mutually exclusive.
Custom mlr3 defaults
cores
:Actual default: Auto-detecting the number of cores
Adjusted default: 1
Reason for change: Threading conflicts with explicit parallelization via future.
Dictionary
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
$get("classif.imbalanced_rfsrc")
mlr_learnerslrn("classif.imbalanced_rfsrc")
Meta Information
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, randomForestSRC
Parameters
Id | Type | Default | Levels | Range |
ntree | integer | 3000 | \([1, \infty)\) | |
method | character | rfc | rfc, brf, standard | - |
block.size | integer | 10 | \([1, \infty)\) | |
fast | logical | FALSE | TRUE, FALSE | - |
ratio | numeric | - | \([0, 1]\) | |
mtry | integer | - | \([1, \infty)\) | |
mtry.ratio | numeric | - | \([0, 1]\) | |
nodesize | integer | 15 | \([1, \infty)\) | |
nodedepth | integer | - | \([1, \infty)\) | |
splitrule | character | gini | gini, auc, entropy | - |
nsplit | integer | 10 | \([0, \infty)\) | |
importance | character | FALSE | FALSE, TRUE, none, permute, random, anti | - |
bootstrap | character | by.root | by.root, by.node, none, by.user | - |
samptype | character | swor | swor, swr | - |
samp | untyped | - | - | |
membership | logical | FALSE | TRUE, FALSE | - |
sampsize | untyped | - | - | |
sampsize.ratio | numeric | - | \([0, 1]\) | |
na.action | character | na.omit | na.omit, na.impute | - |
nimpute | integer | 1 | \([1, \infty)\) | |
ntime | integer | - | \([1, \infty)\) | |
cause | integer | - | \([1, \infty)\) | |
proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
xvar.wt | untyped | - | - | |
split.wt | untyped | - | - | |
forest | logical | TRUE | TRUE, FALSE | - |
var.used | character | FALSE | FALSE, all.trees, by.tree | - |
split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
seed | integer | - | \((-\infty, -1]\) | |
do.trace | logical | FALSE | TRUE, FALSE | - |
statistics | logical | FALSE | TRUE, FALSE | - |
get.tree | untyped | - | - | |
outcome | character | train | train, test | - |
ptn.count | integer | 0 | \([0, \infty)\) | |
cores | integer | 1 | \([1, \infty)\) | |
save.memory | logical | FALSE | TRUE, FALSE | - |
References
O’Brien R, Ishwaran H (2019). “A random forests quantile classifier for class imbalanced data.” Pattern Recognition, 90, 232--249. doi:10.1016/j.patcog.2019.01.036 .
Chao C, Leo B (2004). “Using Random Forest to Learn Imbalanced Data.” University of California, Berkeley.
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
-> LearnerClassifImbalancedRandomForestSRC
Methods
Method importance()
The importance scores are extracted from the slot importance
.
Returns
Named numeric()
.
Examples
learner = mlr3::lrn("classif.imbalanced_rfsrc")
print(learner)
#> <LearnerClassifImbalancedRandomForestSRC:classif.imbalanced_rfsrc>: Imbalanced Random Forest
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, randomForestSRC
#> * Predict Types: [response], prob
#> * Feature Types: logical, integer, numeric, factor, ordered
#> * Properties: importance, missings, oob_error, twoclass, weights
# available parameters:
learner$param_set$ids()
#> [1] "ntree" "method" "block.size" "fast"
#> [5] "ratio" "mtry" "mtry.ratio" "nodesize"
#> [9] "nodedepth" "splitrule" "nsplit" "importance"
#> [13] "bootstrap" "samptype" "samp" "membership"
#> [17] "sampsize" "sampsize.ratio" "na.action" "nimpute"
#> [21] "ntime" "cause" "proximity" "distance"
#> [25] "forest.wt" "xvar.wt" "split.wt" "forest"
#> [29] "var.used" "split.depth" "seed" "do.trace"
#> [33] "statistics" "get.tree" "outcome" "ptn.count"
#> [37] "cores" "save.memory"