predict.mlr | R Documentation |
The function predict.mlr makes predictions for a test/validation set based on a fitted mlr model
## S3 method for class 'mlr'
predict(object, newX, ...)
object |
An |
newX |
An N by P matrix with predictor variables for a test/validation set |
... |
additional arguments to be passed. |
This function returns an object of the class p.mlr
with components:
Ghat |
Predicted values (probabilities) for the test set |
## Not run:
data(dataExample_mru)
y = as.matrix(dataExample_mru[ , 1])
X = as.matrix(dataExample_mru[ , 2:6])
output = mlr(y = y, X = X, base = 1)
preds = predict(output, newX = X[1:4, ])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.