gs_rusranger: Grid Search

View source: R/cv_rusranger.R

gs_rusrangerR Documentation

Grid Search

Description

Grid search to optimise hyperparameters for rusranger()

Usage

gs_rusranger(x, y, searchspace, nfolds = 5, nrepcv = 2, ...)

Arguments

x

matrix/data.frame, feature matrix, see ranger() for details.

y

numeric/factor, classification labels, see ranger() for details.

searchspace

data.frame, hyperparameters to tune. Column names have to match the argument names of ranger()/rusranger().

nfolds

integer(1) number of cross validation folds.

nrepcv

integer(1) number of repeats.

...

further arguments passed to rcv_rusranger().

Value

data.frame with tested hyperparameters and AUCs

Examples

iris <- subset(iris, Species != "setosa")
searchspace <- expand.grid(
   mtry = c(2, 3),
   num.trees = c(500, 1000)
)
## nfolds and nrepcv are too low for real world applications, and are just
## used for demonstration and to keep the run time of the examples low
gs_rusranger(
    iris[-5], as.numeric(iris$Species == "versicolor"),
    searchspace = searchspace, nfolds = 3, nrepcv = 1
)

ampel-leipzig/rusranger documentation built on April 28, 2022, 3:22 a.m.