View source: R/dimensionality_reduction.R
PredictPLS | R Documentation |
Computes predicted values from a Partial Least Squares (PLS) model in
regression mode applied on xdata
. This function is using the algorithm
implemented in predict.pls
.
PredictPLS(xdata, model)
xdata |
matrix of predictors with observations as rows and variables as columns. |
model |
output of |
An array of predicted values.
PLS
if (requireNamespace("mixOmics", quietly = TRUE)) {
# Data simulation
set.seed(1)
simul <- SimulateRegression(n = 100, pk = c(5, 5, 5), family = "gaussian")
x <- simul$xdata
y <- simul$ydata
# PLS
mypls <- PLS(xdata = x, ydata = y, ncomp = 3)
# Predicted values
predicted <- PredictPLS(xdata = x, model = mypls)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.