Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLSRegression alters input matrices #63

Open
mfschmidt opened this issue Dec 7, 2022 · 1 comment
Open

PLSRegression alters input matrices #63

mfschmidt opened this issue Dec 7, 2022 · 1 comment

Comments

@mfschmidt
Copy link

First, thank you so much for this repo! Trying to compare results between python and matlab has been an insane headache until I found this. :)

I noticed that every time I run pls_regression(), my X and Y input matrices both get altered. To prevent this, I am currently creating a sacrificial copy of each original matrix for use with pls_regression, and all's well. But I wanted to report that this surprised me. I would expect that my source data not be altered.

I assume this could be fixed by creating local copies of X and Y_agg prior to

X -= np.nanmean(X, axis=0, keepdims=True)
, and using the local copies rather than references to the originals throughout that function, but I'm not familiar enough with the rest of the codebase to say that with confidence.

Best wishes!

@LuuuXG
Copy link

LuuuXG commented Jul 30, 2024

I also found this issue. Unfortunately, the author team doesn't seem to have fixed it. Interestingly, if the matrix is z-score transformed beforehand, it seems that performing pls_regression() does not change the input matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants