Original made in Colabotory, it will have three version:
- Colaboratory
- Jupyter notebook
- Python script
In this repository we will show how to apply PCA to reduce dimensionality in datasets.
Steps involved in PCA
- Standardize the data
- Compute covariance matrix
- Obtain the Eigenvectors and Eigenvalues from the covariance matrix
- Sort eigenvalues in descending order and choose the top k Eigenvectors that correspond to the k largest eigenvalues
- nstruct the projection matrix W from the selected k Eigenvectors
- Transform the original data set X via W to obtain the new k-dimensional feature subspace Y
.
├── .gitignore
├── README.md
├── requirements.txt
├── jupyter/
│ └── pca.ipynb
├── script/
│ └── pca.py
│ └── pca.png
- pip install -r requirements.txt
- python script/pca.py
- jupyter notebook jupyter/pca.ipynb