Predicted values based on sparse PLS, group PLS, sparse group PLS, sparse PLSda, group PLSda, sparse group PLSda models. New responses and variates are predicted using a fitted model and a new matrix of observations.
# S3 method for sPLS
predict(object, newdata, ...)# S3 method for gPLS
predict(object, newdata, ...)
# S3 method for sgPLS
predict(object, newdata, ...)
# S3 method for sPLSda
predict(object, newdata, method = c("all", "max.dist",
"centroids.dist", "mahalanobis.dist"), ...)
# S3 method for gPLSda
predict(object, newdata, method = c("all", "max.dist",
"centroids.dist", "mahalanobis.dist"), ...)
# S3 method for sgPLSda
predict(object, newdata, method = c("all", "max.dist",
"centroids.dist", "mahalanobis.dist"), ...)
predict
produces a list with the following components:
A three dimensional array of predicted response values. The dimensions correspond to the observations, the response variables and the model dimension, respectively.
Matrix of predicted variates.
Matrix of regression coefficients (without the intercept).
vector or matrix of predicted class by using \(1,...,\)ncomp
(sparse)PLS-DA components.
matrix of coordinates for centroids.
object of class inheriting from "sPLS"
, "gPLS"
, "sgPLS"
, "sPLSda"
, "gPLSda"
or "sgPLSda"
.
data matrix in which to look for for explanatory variables to be used for prediction.
method to be applied for sPLSda
, gPLSda
or sgPLSda
to predict the class of new data,
should be a subset of "centroids.dist"
, "mahalanobis.dist"
or "max.dist"
(see Details).
Defaults to "all"
.
not used currently.
Benoit Liquet and Pierre Lafaye de Micheaux
The predict
function for pls and spls object has been created by Sebastien Dejean, Ignacio Gonzalez, Amrit Singh and Kim-Anh Le Cao for mixOmics
package. Similar code is used for sPLS, gPLS, sgPLS, sPLSda, gPLSda, sgPLSda models performed by sgPLS
package.
predict
function produces predicted values, obtained by evaluating the sparse PLS, group PLS or sparse group PLS
model returned by sPLS
, gPLS
or sgPLS
in the frame newdata
.
Variates for newdata
are also returned. The prediction values are calculated based on the regression coefficients of object$Y
onto object$variates$X
.
Different class prediction methods are proposed for sPLSda
, gPLSda
or sgPLSda
: "max.dist"
is the naive method to predict the class. It is based on the predicted matrix (object$predict
)
which can be seen as a probability matrix to assign each test data to a class. The class with the largest
class value is the predicted class. "centroids.dist"
allocates the individual \(x\) to the class of
\(Y\) minimizing \(dist(\code{x-variate}, G_l)\), where \(G_l\), \(l = 1,...,L\) are the centroids of
the classes calculated on the \(X\)-variates of the model. "mahalanobis.dist"
allocates the individual
\(x\) to the class of \(Y\) as in "centroids.dist"
but by using the Mahalanobis metric
in the calculation of the distance.
Tenenhaus, M. (1998). La r\'egression PLS: th\'eorie et pratique. Paris: Editions Technic.
sPLS
, gPLS
, sgPLS
, sPLSda
, gPLSda
, sgPLSda
.