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

Incorrect implementation of Participation Ratio #14

Open
RylanSchaeffer opened this issue Sep 24, 2022 · 2 comments
Open

Incorrect implementation of Participation Ratio #14

RylanSchaeffer opened this issue Sep 24, 2022 · 2 comments

Comments

@RylanSchaeffer
Copy link

RylanSchaeffer commented Sep 24, 2022

I just noticed what I think might be a problem with your implementation of Participation Ratio!

Suppose one is given a matrix X with shape (num samples, num features). The PR is given by square(sum(eigenvalues)) / sum(square(eigenvalues)) of X^T X, but the implementation uses PCA.

pca = PCA().fit(X)

This is incorrect because PCA first demeans the data. I don't think that's correct.

@j-bac
Copy link
Collaborator

j-bac commented Sep 26, 2022

I couldn't find the original reference of participation ratio, maybe you know it ? It seems usual practice to refer to PR of eigenvalues of the covariance matrix. But I can add an option to return eigenvalues without centering if you need it for your application, thanks for the suggestion!

@RylanSchaeffer
Copy link
Author

RylanSchaeffer commented Sep 26, 2022

I also double checked, and I'm not sure either. Regardless, an optional flag would be awesome, thank you!

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