predict.fastPLS {fastPLS} | R Documentation |
Prediction Partial Least Squares regression.
Description
Partial Least Squares (PLS) regression for test set from training set.
Usage
## S3 method for class 'fastPLS'
predict(object, newdata, Ytest=NULL, proj=FALSE, ...)
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. |
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) |
Author(s)
Dupe Ojo, Alessia Vignoli, Stefano Cacciatore, Leonardo Tenori
See Also
Examples
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)
[Package fastPLS version 0.2 Index]