This function is just a wrapper over the predict function. It sets different default parameters for models from different classes. For example: for classification random Forest is forces the output to be probabilities not classes itself.
yhat(X.model, newdata, ...)# S3 method for lm
yhat(X.model, newdata, ...)
# S3 method for randomForest
yhat(X.model, newdata, ...)
# S3 method for default
yhat(X.model, newdata, ...)
object - a model to be explained
data.frame or matrix - observations for prediction
other parameters that will be passed to the `predict` function
An numeric matrix of predictions. Can have more than one collumn.
We use the `yhat` name instead of `predict` since we need different defaults that the one set in the `predict` function.