View source: R/vars-strategy.R
| vars_uniform | R Documentation |
Creates a variable selection strategy that randomly selects a subset
of variables at each split. Used with pprf for random forests.
vars_uniform(n_vars = NULL, p_vars = NULL)
n_vars |
The number of variables to consider at each split (integer).
Cannot be used together with |
p_vars |
The proportion of variables to consider at each split
(number between 0 and 1, exclusive). Resolved to an integer count when
the number of features is known. Cannot be used together with |
Exactly one of n_vars or p_vars may be specified. When
p_vars is used, it is stored as-is and resolved to an integer count
later by pprf once the number of features is known.
A vars_strategy object.
pprf, vars_all, pp_pda, cutpoint_mean_of_means
# Select 2 variables at each split
vars_uniform(n_vars = 2)
# Select half the variables at each split
vars_uniform(p_vars = 0.5)
# Use with pprf
pprf(Species ~ ., data = iris, vars = vars_uniform(n_vars = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.