Determine largest value of mtry from formula.
This function potentially caps the value of mtry
based on a formula and
data set. This is a safe approach for survival and/or multivariate models.
Source: R/partykit.R
max_mtry_formula.Rd
Determine largest value of mtry from formula.
This function potentially caps the value of mtry
based on a formula and
data set. This is a safe approach for survival and/or multivariate models.
Arguments
- mtry
An initial value of
mtry
(which may be too large).- formula
A model formula.
- data
The training set (data frame).
Examples
# should be 9
max_mtry_formula(200, cbind(wt, mpg) ~ ., data = mtcars)
#> [1] 9