gngdb / pytorch-pca

Minimal implementation of PCA in PyTorch, tested against scikit-learn's implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 PCA
  • incremental_pca.py: matches sklearn's IncrementalPCA, contributed by: yry

Install

Open pca.py, copy the code you'd like to use and then paste it where you'd like to use it.

About

Minimal implementation of PCA in PyTorch, tested against scikit-learn's implementation

License:MIT License


Languages

Language:Python 100.0%