predict.clmdu {lmap} | R Documentation |
The function predict.clmdu makes predictions for a test/validation set based on a fitted cl restricted multidimensional unfolding model (clmdu with X)
Description
The function predict.clmdu makes predictions for a test/validation set based on a fitted cl restricted multidimensional unfolding model (clmdu with X)
Usage
## S3 method for class 'clmdu'
predict(object, newX, newY = NULL, ...)
Arguments
object |
An |
newX |
An N by P matrix with predictor variables for a test/validation set |
newY |
An N by R matrix with response variables for a test/validation set |
... |
additional arguments to be passed. |
Value
This function returns an object of the class predclpca
with components:
Yhat |
Predicted values for the test set |
devr |
Estimated prediction deviance for separate responses |
devtot |
Estimated prediction deviance for all responses |
Examples
## Not run:
data(dataExample_clpca)
Y = as.matrix(dataExample_clmdu[ , 1:8])
X = as.matrix(dataExample_clmdu[ , 9:13])
newY = as.matrix(dataExample_clmdu[1:20 , 1:8])
newX = as.matrix(dataExample_clmdu[1:20 , 9:13])
# supervised
output = clmdu(Y = Y, X = X, S = 2)
preds = predict(output, newX = newX, newY = newY)
## End(Not run)
[Package lmap version 0.1.2 Index]