Learn R Programming

fastPLS (version 0.2)

predict.fastPLS: Prediction Partial Least Squares regression.

Description

Partial Least Squares (PLS) regression for test set from training set.

Usage

# S3 method for fastPLS
predict(object, newdata, Ytest=NULL, proj=FALSE, ...)

Value

A list with the following components:

Ypred

the (ntest x m x length(ncomp)) containing the predicted values of the response variables for the observations from Xtest. The third dimension of the matrix Ypred corresponds to the number of PLS components used to compute the regression coefficients.

Q2Y

predictive power of model

Ttest

the (ntrain x max(ncomp)) matrix containing the X-scores (latent components)

Arguments

object

a matrix of training set cases.

newdata

a matrix of predictor variables X for the test set.

Ytest

a vector of the response variable Y from Xtest.

proj

projection of the test set.

...

further arguments. Currently not used.

Author

Dupe Ojo, Alessia Vignoli, Stefano Cacciatore, Leonardo Tenori

See Also

optim.pls.cv,pls.double.cv

Examples

Run this code
data(iris)
data=iris[,-5]
labels=iris[,5]
ss=sample(150,15)
ncomponent=3

z=pls(data[-ss,], labels[-ss],  ncomp=ncomponent) 
predict(z,data[ss,],FALSE)


Run the code above in your browser using DataLab