By using the PLS Regression, you can follow thisthese steps:
- Apply the algorithm by using a validation method (iI recommend the full cross validation);
- Select the number of latent variables that the validation gives to you;
- Re-run the plsPLS algorithm with the number of latent variables in step 2 and re-apply the cross validation.
With thisthese 3 steps, you can obtain an $\hat{y}$ but the $X$ now is the result of the combination of the old variables, the Score Matrix. Basically you can only compare the original $y$ with the new $\hat{y}$, because of the nature of the latent variables that you select.