@@ -4,6 +4,7 @@ Principal Component Anlaysis (PCA) in PyTorch. The intention is to provide a
4
4
simple and easy to use implementation of PCA in PyTorch, the most similar to
5
5
the ` sklearn ` 's PCA as possible (in terms of API and, of course, output).
6
6
7
+ [ ![ Release] ( https://img.shields.io/github/v/tag/valentingol/torch_pca?label=Pypi&logo=pypi&logoColor=yellow )] ( https://pypi.org/project/torch_pca/ )
7
8
![ PythonVersion] ( https://img.shields.io/badge/python-3.8%20%7E%203.11-informational )
8
9
![ PytorchVersion] ( https://img.shields.io/badge/pytorch-1.8%20%7E%201.13%20%7C%202.0+-informational )
9
10
@@ -17,6 +18,17 @@ the `sklearn`'s PCA as possible (in terms of API and, of course, output).
17
18
[ ![ Flake8] ( https://github.com/valentingol/torch_pca/actions/workflows/flake.yaml/badge.svg )] ( https://github.com/valentingol/Dinosor/actions/workflows/flake.yaml )
18
19
[ ![ Pydocstyle] ( https://github.com/valentingol/torch_pca/actions/workflows/pydocstyle.yaml/badge.svg )] ( https://github.com/valentingol/Dinosor/actions/workflows/pydocstyle.yaml )
19
20
[ ![ MyPy] ( https://github.com/valentingol/torch_pca/actions/workflows/mypy.yaml/badge.svg )] ( https://github.com/valentingol/Dinosor/actions/workflows/mypy.yaml )
21
+ [ ![ PyLint] ( https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/8fb4f3f78584e085dd7b0cca7e046d1f/raw/torch_pca_pylint.json )] ( https://github.com/valentingol/torch_pca/actions/workflows/pylint.yaml )
22
+
23
+ [ ![ Tests] ( https://github.com/valentingol/torch_pca/actions/workflows/tests.yaml/badge.svg )] ( https://github.com/valentingol/torch_pca/actions/workflows/tests.yaml )
24
+ [ ![ Coverage] ( https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/valentingol/c5a6b5731db93da673f8e258b2669080/raw/torch_pca_tests.json )] ( https://github.com/valentingol/torch_pca/actions/workflows/tests.yaml )
25
+ [ ![ Documentation Status] ( https://readthedocs.org/projects/torch-pca/badge/?version=latest )] ( https://torch-pca.readthedocs.io/en/latest/?badge=latest )
26
+
27
+ ## Links
28
+
29
+ Pypi project: https://pypi.org/project/torch_pca/
30
+
31
+ Documentation: https://torch-pca.readthedocs.io/en/latest/
20
32
21
33
## Installation
22
34
@@ -31,12 +43,12 @@ Exactly like `sklearn.decomposition.PCA` but it uses PyTorch tensors as input an
31
43
``` python
32
44
from torch_cpa import PCA
33
45
34
- # Create like sklearn.decomposition.PCA
35
- pca_model = PCA(n_components = None , whiten = False )
46
+ # Create like sklearn.decomposition.PCA, e.g.:
47
+ pca_model = PCA(n_components = None , svd_solver = ' full ' )
36
48
37
- # Use like sklearn.decomposition.PCA
38
- >> > new_X1 = pca_model.fit_transform(X1 )
39
- >> > new_X2 = pca_model.transform(X2 )
49
+ # Use like sklearn.decomposition.PCA, e.g.:
50
+ >> > new_train_data = pca_model.fit_transform(train_data )
51
+ >> > new_test_data = pca_model.transform(test_data )
40
52
>> > print (pca.explained_variance_ratio_)
41
53
[0.756 , 0.142 , 0.062 , ... ]
42
54
```
0 commit comments