fit {MachineShop} | R Documentation |
Fit a model to estimate its parameters from a data set.
fit(x, ...) ## S3 method for class 'formula' fit(x, data, model, ...) ## S3 method for class 'matrix' fit(x, y, model, ...) ## S3 method for class 'ModelFrame' fit(x, model, ...) ## S3 method for class 'recipe' fit(x, model, ...) ## S3 method for class 'MLModel' fit(x, ...) ## S3 method for class 'MLModelFunction' fit(x, ...)
x |
input specifying a relationship between model predictor and response variables. Alternatively, a model function or call may be given first followed by the input specification. |
... |
arguments passed to other methods. |
data |
data frame containing observed predictors and outcomes. |
model |
model function, function name, or call; ignored and can be omitted when fitting modeled inputs. |
y |
response variable. |
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.
MLModelFit
class object.
as.MLModel
, response
,
predict
, varimp
## 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)