If I try and write PCA from memory in PyTorch I always make a mistake so it
doesn't do exactly the same thing as scikit-learn's PCA with the same settings.
This is a minimal implementation of PCA that matches scikit-learn's with default
settings (run pca.py
to test this).
Now includes:
pca.py
: matches sklearn's PCAincremental_pca.py
: matches sklearn's IncrementalPCA, contributed by:yry
Open pca.py
, copy the code you'd like to use and then paste it where you'd
like to use it.
valentingol
'storch_pca
appears to be a more full featured and faster (it chooses an appropriate PCA algorithm depending on input dimensions) alternative PCA implementation also matching scikit-learn.