ModelFrame-methods: ModelFrame Class

Description Usage Arguments Value See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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 values to use in conducting stratified resample estimation of model performance [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

fit, resample, response, SelectedInput

Examples

1
2
3
4
5
6
## 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 documentation built on June 18, 2021, 9:06 a.m.