:crown: Multivariate exploratory data analysis in Python — PCA, CA, MCA, MFA, FAMD, GPA
:crown: Multivariate exploratory data analysis in Python — PCA, CA, MCA, MFA, FAMD, GPA
Prince is a Python library for multivariate exploratory data analysis in Python. It includes a variety of methods for summarizing tabular data, including principal component analysis (PCA) and correspondence analysis (CA). Prince provides efficient implementations, using a scikit-learn API.
I made Prince when I was at university, back in 2016. I spent a significant amount of time in 2022 to revamp the entire package. It is thoroughly tested and supports many features, such as supplementary row/columns, as well as row/column weights.
…>>> chart = pca.plot(dataset)
>>> chart = pca.plot(
... dataset,
... show_row_labels=True,
... show_row_markers=False,
... row_labels_column='athlete',
... color_rows_by='competition'
... )
pip install princePrince uses Altair for making charts.
flowchart TD
groups?(Groups of columns?) --> |"✅"| MFA
groups? --> |"❌"| cat?(Categorical data?)
cat? --> |"✅"| num_too?(Numerical data too?)
num_too? --> |"✅"| FAMD
num_too? --> |"❌"| multiple_cat?(More than two columns?)
multiple_cat? --> |"✅"| MCA
multiple_cat? --> |"❌"| CA
cat? --> |"❌"| shapes?(Analysing shapes?)
shapes? --> |"✅"| GPA
shapes? --> |"❌"| manifold?(Data on a manifold?)
manifold? --> |"✅"| PGA
manifold? --> |"❌"| PCAPrince is tested against scikit-learn and FactoMineR. For the latter, rpy2 is used to run code in R, and convert the results to Python, which allows running automated tests. PGA is tested against geomstats. See more in the tests directory.
Please use this citation if you use this software as part of a scientific publication.
@software{Halford_Prince,
author = {Halford, Max},
license = {MIT},
title = {{Prince}},
url = {https://github.com/MaxHalford/prince}
}The MIT License (MIT). Please see the license file for more information.
No open issues yet, or sync has not completed.