Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ModelFrame-methods

ModelFrame Class


Description

Class for storing data, formulas, and other attributes for MachineShop model fitting.

Usage

ModelFrame(x, ...)

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

## S3 method for class 'matrix'
ModelFrame(
  x,
  y = NULL,
  na.rm = TRUE,
  offsets = NULL,
  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 for any of the model variables.

weights

vector of case weights [default: equal].

strata

vector of resampling stratification levels [default: none].

y

response variable.

offsets

numeric vector, matrix, or data frame of values to be added with a fixed coefficient of 1 to linear predictors in compatible regression models.

Value

ModelFrame class object that inherits from data.frame.

See Also

Examples

## Requires prior installation of suggested package gbm to run

mf <- ModelFrame(ncases / (ncases + ncontrols) ~ agegp + tobgp + alcgp,
                 data = esoph, weights = with(esoph, ncases + ncontrols))
gbm_fit <- fit(mf, model = GBMModel)
varimp(gbm_fit)

MachineShop

Machine Learning Models and Tools

v2.8.0
GPL-3
Authors
Brian J Smith [aut, cre]
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.