Learn R Programming

lmap (version 0.2.4)

predict.lmdu: The function predict.lmdu makes predictions for a test/validation set based on a fitted lrmdu model (lmdu with X)

Description

The function predict.lmdu makes predictions for a test/validation set based on a fitted lrmdu model (lmdu with X)

Usage

# S3 method for lmdu
predict(object, newX, newY = NULL, ...)

Value

This function returns an object of the class lpca with components:

Yhat

Predicted values for the test set

devr

Estimated prediction deviance for separate responses

devtot

Estimated prediction deviance for all responses

Brier.r

Estimated Brier score for separate responses

Brier

Estimated Brier score for all responses

Arguments

object

An lmdu object

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.

Examples

Run this code
if (FALSE) {
data(dataExample_lpca)
Y = as.matrix(dataExample_lmdu[-c(1:20) , 1:8])
X = as.matrix(dataExample_lmdu[-c(1:20) , 9:13])
newY = as.matrix(dataExample_lmdu[1:20 , 1:8])
newX = as.matrix(dataExample_lmdu[1:20 , 9:13])
# supervised
output = lmdu(Y = Y, X = X, S = 2)
preds = predict(output, newX = newX, newY = newY)
}

Run the code above in your browser using DataLab