 
pca is a Python package for Principal Component Analysis. The core of PCA is built on sklearn functionality to find maximum compatibility when combining with other packages.
But this package can do a lot more. Besides the regular PCA, it can also perform SparsePCA, and TruncatedSVD. Depending on your input data, the best approach can be chosen.
pca contains the most-wanted analysis and plots. Navigate to API documentations for more detailed information. ⭐️ Star it if you like it ⭐️
| Feature | Description | Docs | Medium | Gumroad & Podcast | 
|---|---|---|---|---|
| Fit and Transform | Perform the PCA analysis. | Link | PCA Guide | Link | 
| Biplot and Loadings | Make Biplot with the loadings. | Link | – | – | 
| Explained Variance | Determine the explained variance and plot. | Link | – | – | 
| Best Performing Features | Extract the best performing features. | Link | – | – | 
| Scatterplot | Create scatterplot with loadings. | Link | – | – | 
| Outlier Detection | Detect outliers using Hotelling T2 and/or SPE/Dmodx. | Link | Outlier Detection | Link | 
| Normalize out Variance | Remove any bias from your data. | Link | – | – | 
| Save and load | Save and load models. | Link | – | – | 
| Analyze discrete datasets | Analyze discrete datasets. | Link | – | – | 
- Example Notebooks: Examples
- Medium Blogs Medium
- Gumroad Blogs with podcast: GumRoad
- Documentation: Website
- Bug Reports and Feature Requests: GitHub Issues
pip install pcafrom pca import pca| Quick Start | Make Biplot | 
|---|---|
|   |   | 
| Explained Variance Plot | 3D Plots | 
|   |   | 
| Alpha Transparency | Normalize Out Principal Components | 
|   |   | 
| Extract Feature Importance | |
| Make the biplot to visualize the contribution of each feature to the principal components.     | |
| Detect Outliers | Show Only Loadings | 
| Detect outliers using Hotelling's T² and Fisher’s method across top components (PC1–PC5).     |   | 
| Select Outliers | Toggle Visibility | 
| Select and filter identified outliers for deeper inspection or removal. | Toggle visibility of samples and components to clean up visualizations. | 
| Map Unseen Datapoints | |
| Project new data into the transformed PCA space. This enables testing new observations without re-fitting the model. | |
Setting up and maintaining PCA has been possible thanks to users and contributors. Thanks to: