predict.subsemble: Predict method for a 'subsemble' object.
Description
Obtains predictions on a new data set from a subsemble
fit. May require the original data, X
, if one of the learner algorithms uses the original data in its predict method.
Usage
# S3 method for subsemble
predict(object, newx, x = NULL, y = NULL, ...)
Arguments
object
An object of class 'subsemble', which is returned from the subsemble
function.
newx
The predictor variables for a new (testing) data set. The structure should match x
.
x
Original data set used to fit object
.
y
Original outcome used to fit object
.
…
Additional arguments passed to the predict.SL.*
functions.
Value
predPredicted values from subsemble fit.
subpredA data.frame with the predicted values from each sublearner algorithm for the rows in newx
. If we have trained M individual models, then there will be M columns.
Details
If newx
is omitted, the predicted values from object
are returned. The learner
algorithm needs to have a corresponding prediction function with ``predict'' prefixed onto the algorithm name (e.g. predict.SL.glm
for SL.glm
). This should be taken care of by the SuperLearner
package.
Examples
Run this code# NOT RUN {
# See subsemble() function documentation for an example.
# }
Run the code above in your browser using DataLab