Learn R Programming

MachineShop (version 1.3.0)

ModelFrame: ModelFrame Class

Description

Class for storing data, formulas, and other attributes for fitting MLModels.

Usage

ModelFrame(x, ...)

# S3 method for formula ModelFrame(x, data, na.rm = TRUE, weights = NULL, strata = NULL, ...)

# S3 method for matrix ModelFrame(x, y = NULL, na.rm = TRUE, weights = NULL, strata = NULL, ...)

Arguments

x

model formula or matrix of predictor variables.

...

arguments passed to other methods.

data

data.frame or an object that can be converted to one.

na.rm

logical indicating whether to remove cases with NA values

weights

vector of case weights.

strata

vector of stratification levels. for any of the model variables.

y

response variable.

Value

ModelFrame class object that inherits from data.frame.

See Also

formula

Examples

Run this code
# NOT RUN {
mf <- ModelFrame(ncases / (ncases + ncontrols) ~ agegp + tobgp + alcgp,
                 data = esoph, weights = with(esoph, ncases + ncontrols))
gbmfit <- fit(mf, model = GBMModel)
varimp(gbmfit)

# }

Run the code above in your browser using DataLab