Generates predictions using a unified interface across all classifiers.
This function is a compatibility wrapper around the standard predict() method for "classbound" objects.
Usage
predict_model(model, newdata, predict_args = list(), predfun = NULL, ...)Arguments
- model
A fitted classbound model. This corresponds to the
objectargument used by the standard Rpredict()generic. This wrapper callspredict(model, ...).- newdata
A data frame of new observations to predict on.
- predict_args
A named list of additional arguments passed to
predict_adapter.- predfun
A custom function to generate predictions for non-standard models. The function must accept at least two arguments:
model(the fitted native model) andnewdata(a data frame of new observations). It should return either a vector/factor of predicted classes, or a list containingclass(predicted labels) andprobs(a probability matrix).- ...
Additional arguments passed to the specific model adapter.