predict_growth: Predict from growth-curve SuperLearner fit

Description Usage Arguments Value

View source: R/predict.R

Description

Predict from growth-curve SuperLearner fit

Usage

1
2
3
predict_growth(modelfit, newdata, add_subject_data = FALSE, grid = FALSE,
  subset_idx = NULL, holdout = FALSE, stack = TRUE,
  verbose = getOption("growthcurveSL.verbose"))

Arguments

modelfit

Model fit object returned by fit_growth.

newdata

Subject-specific data for which predictions should be obtained. If missing then the predictions for the training data will be typically returned. See holdout for discussion of alternative cases.

add_subject_data

Set to TRUE to add the subject-level data to the resulting predictions (returned as a data.table). When FALSE (default) only the actual predictions are returned (as a matrix with each column representing predictions from a specific model).

grid

Optional flag, set to TRUE when making growth curve predictions for an entire grid of<c2><a0>equally spaced time-points.

subset_idx

A vector of row indices in newdata for which the predictions should be obtain. Default is NULL in which case all observations in newdata will be used for prediction.

holdout

Set to TRUE for out-of-sample predictions for validation folds (out-of-sample observations) or holdouts. When newdata is missing there are two possible types of holdout predictions, depending on the modeling approach. 1. For method = "holdout" the default holdout predictions will be based on validation data. 2. For method = "cv" the default is to leave use the previous out-of-sample (holdout) predictions from the training data.

stack

Stack the predictions from individual models into a single vector of Super Learner predictions (default). If set to FALSE the usual by model (by library) predictions are returned for every successful model fit in the library.

verbose

Set to TRUE to print messages on status and information to the console.

Value

A data.table of subject level predictions (subject are rows, columns are different models) or a data.table with subject level covariates added along with model-based predictions.


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