Grid search to optimise hyperparameters for rusranger()
gs_rusranger(x, y, searchspace, nfolds = 5, nrepcv = 2, ...)matrix/data.frame, feature matrix, see ranger() for
details.
numeric/factor, classification labels, see ranger() for
details.
data.frame, hyperparameters to tune. Column names have
to match the argument names of ranger()/rusranger().
integer(1) number of cross validation folds.
integer(1) number of repeats.
further arguments passed to rcv_rusranger().
data.frame with tested hyperparameters and AUCs
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
)
#> mtry num.trees Min Q1 Median Q3 Max
#> 1 2 500 0.020761246 0.020761246 0.020761246 0.020761246 0.020761246
#> 2 3 500 0.038062284 0.038062284 0.038062284 0.038062284 0.038062284
#> 3 2 1000 0.008650519 0.008650519 0.008650519 0.008650519 0.008650519
#> 4 3 1000 0.020761246 0.020761246 0.020761246 0.020761246 0.020761246