Learn R Programming

parsnip (version 1.1.0)

max_mtry_formula: 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.

Description

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.

Usage

max_mtry_formula(mtry, formula, data)

Value

A value for mtry.

Arguments

mtry

An initial value of mtry (which may be too large).

formula

A model formula.

data

The training set (data frame).

Examples

Run this code
# should be 9
max_mtry_formula(200, cbind(wt, mpg) ~ ., data = mtcars)

Run the code above in your browser using DataLab