This function generates a sequence of mtry
values for random forests.
var_seq(p, classification = FALSE, len = 3)
p | The number of predictors |
---|---|
classification | Is the outcome a factor ( |
len | The number of |
a numeric vector
If the number of predictors is less than 500, a simple sequence of values of
length len
is generated between 2 and p
. For larger numbers of
predictors, the sequence is created using log2
steps.
If len = 1
, the defaults from the randomForest
package are
used.
var_seq(p = 100, len = 10)#> [1] 2 12 23 34 45 56 67 78 89 100var_seq(p = 600, len = 10)#> [1] 2 3 7 13 25 47 89 168 318 600