I have a matrix X of which, upon centering, I perform SVD. While I get the same magnitude of the loadings, some of the columns produce opposite signs between MATLAB and Python. I understand the opposite signs do not matter as far as the PCA is concerned, however, I need to perform summation of the loading values later on. This causes difference in the results between MATLAB and Python. Therefore, I need same signs of loadings across both MATLAB and Python. What could I do to get the same signs in both the platforms? I am using np.linalg.svd() function in Python and simple svd() function in MATLAB. Please help.
Intriguingly, when X is not centered, I get same signs. I tried sklearn.decomposition.PCA() function in Python as well but to no avail.