asmbPLS.predict {asmbPLS} | R Documentation |
Using an asmbPLS model for prediction of new samples
Description
Derives predictions for new samples from a model fitted by the function
asmbPLS.fit
or mbPLS.fit
.
Usage
asmbPLS.predict(fit.results, X.matrix.new, PLS.comp)
Arguments
fit.results |
The output of either |
X.matrix.new |
A predictors matrix, whose predictors are the same as the predictors in model fitting. |
PLS.comp |
Number of PLS components used for prediction. |
Value
asmbPLSDA.predict
returns a list containing the following components:
Y_pred |
Predicted value for the new sampels. |
NewX_super_score |
Predicted super score for new samples, which can be used as predictors for other regression models. |
Examples
## Use the example dataset
data(asmbPLS.example)
X.matrix = asmbPLS.example$X.matrix
X.matrix.new = asmbPLS.example$X.matrix.new
Y.matrix = asmbPLS.example$Y.matrix
PLS.comp = asmbPLS.example$PLS.comp
X.dim = asmbPLS.example$X.dim
quantile.comb = asmbPLS.example$quantile.comb
## asmbPLS fit
asmbPLS.results <- asmbPLS.fit(X.matrix = X.matrix,
Y.matrix = Y.matrix,
PLS.comp = PLS.comp,
X.dim = X.dim,
quantile.comb = quantile.comb)
## asmbPLS prediction for the new data, you could use different numbers of
## PLS components for prediction
## Use only the first PLS component
Y.pred.1 <- asmbPLS.predict(asmbPLS.results, X.matrix.new, 1)
## Use the first two PLS components
Y.pred.2 <- asmbPLS.predict(asmbPLS.results, X.matrix.new, 2)
[Package asmbPLS version 1.0.0 Index]