predict_save_tgrid: Predict and save the entire growth curve (grid of time...

Description Usage Arguments Value

View source: R/growthcurve_features.R

Description

A thin wrapper for define_features_drop, define_tgrid and predict_SL functions. Evaluates predictions from the existing SuperLearner fit using an entire grid of time points. Optionally, when file.name is not NULL, the resulting dataset of predictions is saved as a csv file.

Usage

1
2
3
predict_save_tgrid(SLfit, data, ID, t_name, y, tmin = 1, tmax = 500,
  incr = 2, file.name = NULL,
  file.path = getOption("growthcurveSL.file.path"))

Arguments

SLfit

SuperLearner fit returned by fit_holdoutSL or fit_cvSL.

data

Input data used for model training.

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).

y

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

tmin

Min t value of the grid

tmax

Max t value of the grid

incr

Increment value for the grid of t's

file.name

A file name (without the .csv extension) in which the prediction dataset will be saved. Leave as NULL is no saving is necessary.

file.path

A directory path in which the predictions file should be saved.

Value

A data.table with subject IDs, grid of equally spaced time-points and the corresponding growth curve predictions. The relevant subject summaries and predictors used for training will be also included in the output data. In addition, the output dataset also contains an indicator column 'train_point', set to TRUE for all (ID,time-points) that also appear in the input data dataDT. That is 'train_point' indicates if the row might have been previously used for model training. Finally, if the argument 'hold_column' is not NULL, the output dataset will contain the indicator column of holdout observations (named according to hold_column argument).


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