vars_uniform: Uniform random variable selection strategy.

View source: R/vars-strategy.R

vars_uniformR Documentation

Uniform random variable selection strategy.

Description

Creates a variable selection strategy that randomly selects a subset of variables at each split. Used with pprf for random forests.

Usage

vars_uniform(n_vars = NULL, p_vars = NULL)

Arguments

n_vars

The number of variables to consider at each split (integer). Cannot be used together with p_vars.

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 n_vars.

Details

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.

Value

A vars_strategy object.

See Also

pprf, vars_all, pp_pda, cutpoint_mean_of_means

Examples

# 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))


ppforest2 documentation built on July 21, 2026, 9:07 a.m.