Skip to main content

Logo

Website Install License Examples Scientific Paper

Riemannian STATS: Statistical Analysis on Riemannian Manifolds


RiemannianStats is an open-source package that implements a novel principal component analysis methodology adapted for data on Riemannian manifolds, using UMAP as a core tool to construct the underlying geometric structure. This tool enables advanced statistical techniques to be applied to any type of dataset, honoring its local geometry, without requiring the data to originate from traditionally geometric domains like medical imaging or shape analysis.

Instead of assuming data resides in Euclidean space, RiemannianStats transforms any data table into a Riemannian manifold by leveraging the local connectivity extracted from a UMAP-generated k-nearest neighbor graph. On top of this structure, the package computes Riemannian principal components, covariance and correlation matrices, and even provides 2D and 3D visualizations that faithfully capture the dataset’s topology.

With Riemannian STATS, you can:

  • Incorporate the local geometry of your data for meaningful dimensionality reduction.
  • Generate visual representations that better reflect the true structure of your data.
  • Use a unified framework that generalizes classical statistical analysis to complex geometric contexts.
  • Apply these techniques to both synthetic and real high-dimensional datasets.

This package is ideal for researchers, data scientists, and developers seeking to move beyond the traditional assumptions of classical statistics, applying models that respect the intrinsic structure of data.

🌐 Package Website

You can explore the Riemannian STATS package documentation , its features, and interactive examples at: 🔗 https://riemannianstats.web.app


Features and Modules

Functionality Module Documentation
Data preprocessing data_processing.py 🔗 data_processing
Riemannian analysis riemannian_analysis.py 🔗 riemannian_analysis
Visualizations (2D/3D) visualization.py 🔗 visualization
Utilities utilities.py 🔗 utilities

📚 Examples of Use

The examples/ directory contains three complete use cases applying Riemannian STATS to different datasets:

Dataset Description Script Results
Iris Applies Riemannian PCA to 150 flowers from 3 species using 4 morphological variables (sepal/petal length and width). Visualizes species in component space. 🧾 example1.py 📊 View Output
Data10D_250 Synthetic dataset with 250 points in 10 dimensions and labeled clusters. Computes UMAP similarities, rho matrix, R-PCA, and correlation analysis. 🧾 example2.py 📊 View Output
Olivetti Faces 400 grayscale face images (64×64 pixels, 4096D) from 40 individuals. Projects them into Riemannian component space for identity separation and visualization. 🧾 example3.py 📊 View Output

📖 For full walkthroughs with inputs, outputs, and visualizations: 📊 Examples Overview


Importing the Package

riemannian_stats supports both PascalCase and lowercase alias imports for flexibility:

# Standard
from riemannian_stats import RiemannianAnalysis, DataProcessing, Visualization, Utilities

# Aliased (optional)
from riemannian_stats import riemannian_analysis, data_processing, visualization, utilities

💡 Both styles provide access to the same functionality—choose the one that best fits your coding preferences.


Installation

Ensure you have Python ≥ 3.8 installed, then run:

pip install riemannian_stats

Alternatively, to install from the source code, clone the repository and execute:

git clone https://github.com/OldemarRodriguez/riemannian_stats.git
cd riemannian_stats
pip install .

This project follows PEP 621 and uses pyproject.toml as the primary configuration file.

Main Dependencies:

  • matplotlib (>=3.7.5, <3.11)
  • pandas (>=2.0.3, <2.3)
  • numpy (>=1.24.4, <3.0)
  • scikit-learn (>=1.3.2, <1.7)
  • umap-learn (>=0.5.7, <0.6)

These dependencies are defined in the pyproject.toml and in requirements.txt .


License

Distributed under the BSD-3-Clause License. See the LICENSE.txt for more details.


Authors & Contributors

  • Oldemar Rodríguez Rojas – Developed the mathematical functions and conducted the research.
  • Jennifer Lobo Vásquez – Led the overall development and integration of the package.

Support & Contributions

If you encounter any issues or have suggestions for improvements, please open an issue on the repository or submit a pull request. Your feedback is invaluable to enhancing the package.

To learn how to contribute effectively, please refer to the Contributing.md file, where you’ll find guidelines and best practices to get involved.


References

Release files for riemannian-stats 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for riemannian-stats 0.1.1
File Size Uploaded
riemannian_stats-0.1.1.tar.gz 11.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for riemannian-stats 0.1.1
File Interpreter ABI Platform
riemannian_stats-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 MB

Release files / riemannian_stats-0.1.1.tar.gz

Download URL riemannian_stats-0.1.1.tar.gz
Size 11.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6ef8c6c8f2badac2d037e1ad27e761f7acc67879353839941c38d7a701e9ed6b
BLAKE2b-256 checksum
How to use checksums
a8e68b070d7a1ec47268f77f851c0b43f2ecf646b26edc518aab926c76be58f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / riemannian_stats-0.1.1-py3-none-any.whl

Download URL riemannian_stats-0.1.1-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3426ff09a0a57582a1a720ce0bdfffb3239c585d0589e87f7912ad1c50770a6
BLAKE2b-256 checksum
How to use checksums
b427340ea27f0c663a6e8128524a29d6ea84e28e568ba2999f7054c55327f660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page