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

PCA Python API #1054

Closed
iyerkrithika21 opened this issue Feb 23, 2021 · 7 comments · Fixed by #1268
Closed

PCA Python API #1054

iyerkrithika21 opened this issue Feb 23, 2021 · 7 comments · Fixed by #1268

Comments

@iyerkrithika21
Copy link
Contributor

Need python API support for performing all PCA operations for correspondence model currently present in Studio.
The API should calculate the following:

  1. Eigenvalues
  2. Eigenvectors
  3. PCA Loading
  4. PCA Component Scores / Variance

All these quantities should be saved as numpy arrays.

@iyerkrithika21
Copy link
Contributor Author

Related to #995

@iyerkrithika21
Copy link
Contributor Author

@akenmorris: Currently, which library does Studio use to perform the principal component analysis?
@sheryjoe Should we use the same library for the API or use python libraries like sklearn to perform the PCA analysis?
If we want to use python libraries, following the same suite of ShapeCohortGenPackage/DataAugmentationsPackage I can start working on PCAPackage in the python library.

@akenmorris
Copy link
Contributor

Studio uses the ParticleShapeStatistics class:

https://github.com/SCIInstitute/ShapeWorks/blob/master/Libs/Particles/ParticleShapeStatistics.h

In general, my recommendation is to use a single library for both. This keeps results and behavior consistent across tools. I worry that having multiple implementations is a step backward into a disjoint set of tools that we've been trying to consolidate over time.

FYI, there are some different plans for the future of statistical analysis including using R.

@archanasri
Copy link
Contributor

Are we planning on creating a pybind wrapper of ParticleShapeStatistics?

@sheryjoe
Copy link
Contributor

sheryjoe commented Mar 3, 2021

Are we planning on creating a pybind wrapper of ParticleShapeStatistics?

Yes, as part of the shapeworks python library.

@cchriste
Copy link
Contributor

#830 #1172

@cchriste
Copy link
Contributor

It’ll be 1000x easier to get this feature out by simply exporting Eigen::Matrix that already has all these functions.

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

Successfully merging a pull request may close this issue.

5 participants