
Last chance! 50% off unlimited learning
Sale ends in
Fit a model to estimate its parameters from a data set.
fit(...)# S3 method for formula
fit(formula, data, model, ...)
# S3 method for matrix
fit(x, y, model, ...)
# S3 method for ModelFrame
fit(input, model = NULL, ...)
# S3 method for recipe
fit(input, model = NULL, ...)
# S3 method for ModelSpecification
fit(object, ...)
# S3 method for MLModel
fit(model, ...)
# S3 method for MLModelFunction
fit(model, ...)
arguments passed from the generic function to its methods and from
the MLModel
and MLModelFunction
methods to others. The
first argument of each fit
method is positional and, as such, must
be given first in calls to them.
formula defining the model predictor and response variables and a data frame containing them.
model function, function name, or object; or another object that can be coerced to a model. A model can be given first followed by any of the variable specifications, and the argument can be omitted altogether in the case of modeled inputs.
matrix and object containing predictor and response variables.
input object defining and containing the model predictor and response variables.
model specification.
MLModelFit
class object.
User-specified case weights may be specified for ModelFrames
upon
creation with the weights
argument in its
constructor.
Variables in recipe
specifications may be designated as case weights
with the role_case
function.
# NOT RUN {
## Requires prior installation of suggested package gbm to run
## Survival response example
library(survival)
gbm_fit <- fit(Surv(time, status) ~ ., data = veteran, model = GBMModel)
varimp(gbm_fit)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab