Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.superlearner

Predict method for SuperLearner object


Description

Obtains predictions on a new data set from a SuperLearner fit. May require the original data if one of the library algorithms uses the original data in its predict method.

Usage

## S3 method for class 'SuperLearner'
predict(object, newdata, X = NULL, Y = NULL,
  onlySL = FALSE, ...)

Arguments

object

Fitted object from SuperLearner

newdata

New X values for prediction

X

Original data set used to fit object, if needed by fit object.

Y

Original outcome used to fit object, if needed by fit object.

onlySL

Logical. If TRUE, only compute predictions for algorithms with non-zero coefficients in the super learner object. Default is FALSE (computes predictions for all algorithms in library).

...

Additional arguments passed to the predict.SL.* functions

Details

If newdata is omitted the predicted values from object are returned. Each algorithm in the Super Learner library needs to have a corresponding prediction function with the “predict.” prefixed onto the algorithm name (e.g. predict.SL.glm for SL.glm).

Value

pred

Predicted values from Super Learner fit

library.predict

Predicted values for each algorithm in library

Author(s)

Eric C Polley epolley@uchicago.edu

See Also


SuperLearner

Super Learner Prediction

v2.0-28
GPL-3
Authors
Eric Polley [aut, cre], Erin LeDell [aut], Chris Kennedy [aut], Sam Lendle [ctb], Mark van der Laan [aut, ths]
Initial release
2021-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.