Skip to contents

This function is the prototype of a predict() S3 method for the S3 object fit_obj of a Model and lays out the minimal requirements for its parameters and return value.

Usage

predict_method_prototype(object, newx, ...)

Arguments

object

The fitted S3 object.

newx

Numeric matrix. The predictor matrix without NAs. Samples correspond to rows. Discrete features are encoded as binary dummy variables. Column names are the same as in the predictor matrix used for fitting.

...

Further parameters specific for the S3 class of object. Ignored by Model$predict().

Value

A numeric one-column matrix with as many rows as newx, the predictions of the (picked) fitted model for the samples in newx. The fitter that outputs object may fit multiple models and store them in object, but the predict() method must return the predictions of the best model among them.