# How to obtain predictor scores from standardized inputs after partial least squares?

3 visualizaciones (últimos 30 días)
Maaz Ahmad el 24 de En. de 2022
Respondida: Akshat el 17 de Nov. de 2023
The function plsregress() returns the PLS components (XS) after linear transformation of inputs. However, after performing PLS on a given data set [X,y], how can one transform a new input x to its corresponding PLS component? The documentation mentions , where X0 is standardized X and W is the weight vector obtained by performing PLS transformation. I cannot validate this on the spectra data set.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

Akshat el 17 de Nov. de 2023
Hi Maaz,
As per my understanding of the question, you want to fit a new input “x” using the weights generated by your data set, “[X,y]”.
As you have rightly identified, we need to use “standardized” version of our new input. That is, the input “x” must be standardized. The process of standardization is done to make the data keep its original properties and make the mean 0 and standard deviation 1.
This can be found in the algorithms section of the documentation of “PLSregress”, the documentation is available in the below link: https://www.mathworks.com/help/stats/plsregress.html#mw_66343793-51f5-466d-b146-3d09043613a1
We can perform this action using the z-score, using the function “zscore”. This function is specifically designed to standardize vectors. You can find the documentation here:
Then, using the following code, I think you can fit the weights on the standardized array.
% Assume X and y are your original data matrices
% Assume x is your new input matrix
% Assume ncomp is the number of PLS components
% Perform PLS regression on the original data
[XL,yl,XS,YS,beta,pctvar,mse,stats] = plsregress(X,y,ncomp);
% Standardize the new input x
x0 = zscore(x);
% Transform the standardized new input to its PLS components
XS_new = x0 * stats.W;
Feel free to follow up in case you have further queries!
Hope this helps!
Regards
Akshat
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by