Learn R Programming

MachineShop (version 1.1.0)

ModelFrame: ModelFrame Class

Description

Class for storing a data frame, formula, and optionally weights for fitting MLModels.

Usage

ModelFrame(x, ...)

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

# S3 method for matrix ModelFrame(x, y, weights = NULL, strata = NULL, na.action = 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.

weights

vector of case weights.

strata

vector of stratification levels.

na.action

action to take if cases contain missing values. The default is first any na.action attribute of data, second a na.action setting of options, and third na.fail if unset.

y

response variable.

Value

ModelFrame class object that inherits from data.frame.

See Also

formula, na.fail, na.omit, na.pass

Examples

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

# }

Run the code above in your browser using DataLab