fit_model: Generic modeling function for longitudinal data.

Description Usage Arguments Value

Description

Generic modeling function for longitudinal data.

Usage

1
2
3
fit_model(ID, t_name, x, y, train_data, valid_data, models, nfolds, fold_column,
  seed, useH2Oframe = FALSE, subset_exprs = NULL, subset_idx = NULL,
  verbose = getOption("gridisl.verbose"), ...)

Arguments

ID

A character string name of the column that contains the unique subject identifiers.

t_name

A character string name of the column with integer-valued measurement time-points (in days, weeks, months, etc).

x

A vector containing the names of predictor variables to use for modeling. If x is missing, then all columns except ID, y are used.

y

A character string name of the column that represent the response variable in the model.

train_data

Input dataset, can be a data.frame or a data.table.

valid_data

Optional data.frame or data.table containing the validation data. When provided, this dataset will be used for scoring the final model fit(s). Can be used with either method = "cv" or "holdout". When method = "cv", the validation data must have exactly the same number of rows as the train_data. Each CV model will be re-scored (MSE) based on validation fold rows in valid_data.

models

Parameters specifying the model(s) to fit. This must be a result of calling defModel(...) + defModel(...) functions.

nfolds

Number of folds to use in cross-validation.

fold_column

The name of the column in the input data that contains the cross-validation fold indicators (must be an ordered factor).

seed

Random number seed for selecting random holdouts or validation folds.

useH2Oframe

Use existing H2OFrame object (if modeling with h2o R package) in input data object, rather than loading a new H2OFrame.

subset_exprs

(Optional) Specify a logical R expression (as character string) for selecting training / validation rows in the input data. The expression will be evaluated in the environment of the input data. By default all rows of the input data will be used.

subset_idx

(Optional) Specify an vector index of rows in the input data to be used in model fitting / validation. By default all rows of the input data will be used.

verbose

Set to TRUE to print messages on status and information to the console. Turn this on by default using options(gridisl.verbose=TRUE).

Value

An R6 object containing the model fit(s).


osofr/longGriDiSL documentation built on May 24, 2019, 4:56 p.m.