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.
# S3 method for SuperLearner
predict(object, newdata, X = NULL, Y = NULL,
onlySL = FALSE, ...)
Fitted object from SuperLearner
New X values for prediction
Original data set used to fit object
, if needed by fit object.
Original outcome used to fit object
, if needed by fit object.
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
Predicted values from Super Learner fit
Predicted values for each algorithm in library
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
).