# How to make predictions wit Partial Least Squares (PLSregress)

15 visualizzazioni (ultimi 30 giorni)
jose Neria il 2 Nov 2016
Risposto: Juan Villacrés il 7 Feb 2019
Hi all. I'm reading the example of how to use partial least squares (https://www.mathworks.com/help/stats/examples/partial-least-squares-regression-and-principal-components-regression.html) But I have a question, if I divide the y-data as
y_train = y(1:50);
y_test = y(51:end);
X_train = X(1:50,:);
X_test = X(51:end,:);
and I follow the exmaple by doing
How can I use this information in order to make predictions for the test data?
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Juan Villacrés il 7 Feb 2019
Hi, this is the way to get the prediction.
y_pred = [ones(size(X_test ,1),1) X_test]*betaPLS;
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Gaussian Process Regression in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by