predict_SL.PredictionStack: Predict for discrete SuperLearner fit

Description Usage Arguments Value

View source: R/fit_SuperLearner_funs.R

Description

Predict for discrete SuperLearner fit

Usage

1
2
3
4
## S3 method for class 'PredictionStack'
predict_SL(modelfit, newdata,
  add_subject_data = FALSE, subset_idx = NULL, holdout = FALSE,
  verbose = getOption("gridisl.verbose"), ...)

Arguments

modelfit

Model fit object returned by fit.

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

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.

verbose

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

...

Additional arguments, used only for compatibility with other predict_SL functions.

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/gridisl documentation built on May 24, 2019, 4:55 p.m.