SelectedInput {MachineShop} | R Documentation |
Formula, design matrix, model frame, or recipe selection from a candidate set.
SelectedInput(...) ## S3 method for class 'formula' SelectedInput( ..., data, control = MachineShop::settings("control"), metrics = NULL, stat = MachineShop::settings("stat.train"), cutoff = MachineShop::settings("cutoff") ) ## S3 method for class 'matrix' SelectedInput( ..., y, control = MachineShop::settings("control"), metrics = NULL, stat = MachineShop::settings("stat.train"), cutoff = MachineShop::settings("cutoff") ) ## S3 method for class 'ModelFrame' SelectedInput( ..., control = MachineShop::settings("control"), metrics = NULL, stat = MachineShop::settings("stat.train"), cutoff = MachineShop::settings("cutoff") ) ## S3 method for class 'recipe' SelectedInput( ..., control = MachineShop::settings("control"), metrics = NULL, stat = MachineShop::settings("stat.train"), cutoff = MachineShop::settings("cutoff") ) ## S3 method for class 'list' SelectedInput(x, ...)
... |
inputs specifying relationships between model predictor and response variables. Supplied inputs must all be of the same type and may be named or unnamed. |
data |
data frame or an object that can be converted to one. |
control |
control function, function name, or call defining the resampling method to be employed. |
metrics |
metric function, function name, or vector of these with which to calculate performance. If not specified, default metrics defined in the performance functions are used. Recipe selection is based on the first calculated metric. |
stat |
function or character string naming a function to compute a summary statistic on resampled metric values for recipe selection. |
cutoff |
argument passed to the |
y |
response variable. |
x |
list of inputs followed by arguments passed to their method function. |
SelectedModelFrame
or SelectedModelRecipe
class object
that inherits from SelectedInput
and ModelFrame
or
recipe
.
## Selected model frame sel_mf <- SelectedInput( sale_amount ~ sale_year + built + style + construction, sale_amount ~ sale_year + base_size + bedrooms + basement, data = ICHomes ) fit(sel_mf, model = GLMModel) ## Selected recipe library(recipes) data(Boston, package = "MASS") rec1 <- recipe(medv ~ crim + zn + indus + chas + nox + rm, data = Boston) rec2 <- recipe(medv ~ chas + nox + rm + age + dis + rad + tax, data = Boston) sel_rec <- SelectedInput(rec1, rec2) fit(sel_rec, model = GLMModel)