copied from mixOmicsTeam/mixOmics/refs/heads/master/R/predict.R on 2025 Jan 30. Some components omitted that are not used in planet.
# S3 method for class 'mixo_pls'
predict(
object,
newdata,
study.test,
dist = c("all", "max.dist", "centroids.dist", "mahalanobis.dist"),
multilevel = NULL,
...
)
# S3 method for class 'mixo_spls'
predict(
object,
newdata,
study.test,
dist = c("all", "max.dist", "centroids.dist", "mahalanobis.dist"),
multilevel = NULL,
...
)
object of class inheriting from
"(mint).(block).(s)pls(da)"
.
data matrix in which to look for for explanatory variables to be used for prediction. Please note that this method does not perform multilevel decomposition or log ratio transformations, which need to be processed beforehand.
For MINT objects, grouping factor indicating which samples
of newdata
are from the same study. Overlap with object$study
are allowed.
distance to be applied for discriminant methods to predict the
class of new data, should be a subset of "centroids.dist"
,
"mahalanobis.dist"
or "max.dist"
(see Details). Defaults to
"all"
.
Design matrix for multilevel analysis (for repeated
measurements). A numeric matrix or data frame. For a one level factor
decomposition, the input is a vector indicating the repeated measures on
each individual, i.e. the individuals ID. For a two level decomposition with
splsda models, the two factors are included in Y. Finally for a two level
decomposition with spls models, 2nd AND 3rd columns in design indicate those
factors (see example in ?splsda
and ?spls
).
not used currently.
predict
produces a list with the following components:
predicted response values. The dimensions correspond to the observations, the response variables and the model dimension, respectively. For a supervised model, it corresponds to the predicted dummy variables.
matrix of predicted variates.
matrix of regression coefficients (without the intercept).
if more than one block, returns the average predicted
values over the blocks (using the predict
output)
if more than one block, returns the weighted average
of the predicted values over the blocks (using the predict
and
weights
outputs)
predicted class of newdata
for each
\(1,...,\)ncomp
components.
if more than one block, returns the majority class over the blocks. NA for a sample means that there is no consensus on the predicted class for this particular sample over the blocks.
if more than one block, returns the weighted majority class over the blocks. NA for a sample means that there is no consensus on the predicted class for this particular sample over the blocks.
Returns the weights of each block used for the weighted predictions, for each nrepeat and each fold
matrix of coordinates for centroids.
type of distance requested.
majority vote result for multi block analysis (see details above).
Rohart F, Gautier B, Singh A, Lê Cao K-A. mixOmics: an R package for 'omics feature selection and multiple data integration. PLoS Comput Biol 13(11): e1005752
Tenenhaus, M. (1998). La regression PLS: theorie et pratique. Paris: Editions Technic.
http://www.mixOmics.org for more details.
# example code