Pretty much a complete newbie with PLS, Python, stats, (and stackexchange), sorry:
When using sklearn for PLSRegression, why is the resulting scores matrix not given by the product of (scaled) input and the weights matrix?
I.e. T = X0 * W
Minimum working example showing this is given below.
I have figured out in the meantime that the scores can be calculated according to an algorithm shown, e.g., here http://www.sciencedirect.com/science/article/pii/0003267086800289?via%3Dihub and that the scores can be calculated via the '.transform' method. But I struggle to understand why this choice was made. Can anyone tell me what's the benefit of having it this way?
Thanks a lot!
import numpy as np # PLS tools from sklearn.preprocessing import scale from sklearn.cross_decomposition import PLSRegression # just some numbers X = np.random.multivariate_normal(np.array([3,4,5]),np.diag([5,4,1]),100) y = np.dot(X,np.array([1,2,3]))+np.random.random(size=(100,)) pls = PLSRegression(n_components=2) pls.fit(scale(X),y) (pls.x_scores_ - np.dot(scale(X),pls.x_weights_)) / pls.x_scores_ # differ significantly from second column on forward