Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

var_seq

Sequences of Variables for Tuning


Description

This function generates a sequence of mtry values for random forests.

Usage

var_seq(p, classification = FALSE, len = 3)

Arguments

p

The number of predictors

classification

Is the outcome a factor (classification = TRUE or numeric?)

len

The number of mtry values to generate.

Details

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.

Value

a numeric vector

Author(s)

Max Kuhn

Examples

var_seq(p = 100, len = 10)
var_seq(p = 600, len = 10)

caret

Classification and Regression Training

v6.0-86
GPL (>= 2)
Authors
Max Kuhn [aut, cre], Jed Wing [ctb], Steve Weston [ctb], Andre Williams [ctb], Chris Keefer [ctb], Allan Engelhardt [ctb], Tony Cooper [ctb], Zachary Mayer [ctb], Brenton Kenkel [ctb], R Core Team [ctb], Michael Benesty [ctb], Reynald Lescarbeau [ctb], Andrew Ziem [ctb], Luca Scrucca [ctb], Yuan Tang [ctb], Can Candan [ctb], Tyler Hunt [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.