Skip to main content

PyPI version Tests Documentation Status CodeFactor DOI License PyPI Downloads

Shesha Logo

Shesha

Pronunciation: SHAY-shuh (/ˈʃeɪʃə/)

Self-consistency metrics for representational stability analysis.

Shesha measures the geometric stability of high-dimensional representations by quantifying the self-consistency of their pairwise distance structure (RDMs) under controlled internal perturbations.

Full documentation at shesha-geometry.readthedocs.io

Installation

pip install shesha-geometry

For single-cell biology workflows (shesha.bio), install with the bio extra, which adds anndata and scikit-learn:

pip install shesha-geometry[bio]

Quick Start

import numpy as np
import shesha

X = np.random.randn(500, 768)  # (n_samples, n_features)

stability = shesha.feature_split(X, n_splits=30, seed=320)
print(f"Feature-split stability: {stability:.3f}")

For the full API reference, installation guide, and usage examples, see the documentation.

Known limitations

  • feature_split measures coordinate-axis redundancy, not basis-invariant geometry. Orthogonal rotations can change the score while leaving pairwise Euclidean RDMs unchanged. See What Shesha does not establish.
  • sample_split and anchor_stability correlate unmatched distance entries and are deprecated. Their outputs must not be used for scientific inference. Use replicate_stability and anchor_profile_stability with matched replicates instead.

Tutorials

Explore shesha with these interactive notebooks (most take < 5 minutes; the vision tutorial is longer because it loads several pretrained models):

  • Open In Colab LLM Embeddings - Analyze embedding stability across layers and models using feature_split.
  • Open In Colab Steering Vectors - Compute steering vectors from contrastive pairs and measure their consistency.
  • Open In Colab Vision Models - Compare geometric stability across ResNets, ViTs, and other architectures.
  • Open In Colab Representational Drift - Measure drift from Gaussian noise injection and LoRA fine-tuning.
  • Open In Colab Training Dynamics - Track geometric stability during training to detect representation collapse.
  • Open In Colab CRISPR (Bio) - Use shesha.bio to analyze coherence in single-cell CRISPR perturbation experiments.

Citation

If you use shesha-geometry, please cite:

@software{shesha2026,
  title = {Shesha: Self-Consistency Metrics for Representational Stability},
  author = {Raju, Prashant C.},
  year = {2026},
  howpublished = {Zenodo},
  doi = {10.5281/zenodo.18227453},
  url = {https://doi.org/10.5281/zenodo.18227453},
  copyright = {MIT License}
}

@article{raju2026geometric,
  title = {Geometric Stability: The Missing Axis of Representations},
  author = {Raju, Prashant C.},
  journal = {arXiv preprint arXiv:2601.09173},
  year = {2026}
}

If you use the supervised variants (supervised_alignment, lda_stability, variance_ratio, class_separation_ratio), please also cite:

@inproceedings{raju2026canary,
  title = {The Geometric Canary: Predicting Steerability and Detecting Drift via Representational Stability},
  author = {Raju, Prashant C.},
  booktitle= {ICML Mechanistic Interpretability Workshop},
  year= {2026}
}

If you use the shesha.bio module, please also cite:

@article{raju2026crispr,
  title = {Directional coherence and effect magnitude in single-cell CRISPR perturbation responses},
  author = {Raju, Prashant C.},
  journal = {arXiv preprint arXiv:2604.16642},
  year = {2026}
}

License

MIT


Logo generated by Nano Banana Pro

Metadata

Release files for shesha-geometry 0.3.0

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

Source distribution (sdist)

Source distribution for shesha-geometry 0.3.0
File Size Uploaded Provenance Actions
shesha_geometry-0.3.0.tar.gz 89.0 kB With provenance Details for shesha_geometry-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shesha-geometry 0.3.0
File Interpreter ABI Platform Actions
shesha_geometry-0.3.0-py3-none-any.whl Python 3 none any Details for shesha_geometry-0.3.0-py3-none-any.whl

Total release size: 134.8 kB

Release files / shesha_geometry-0.3.0.tar.gz

Download URL shesha_geometry-0.3.0.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2518237f52052442f8057f866252501904ed21073c2845876a9427f24ef904cf
BLAKE2b-256 checksum
How to use checksums
eb28ad541b736d7d50cac29e24e6ae7ea70ce1d5e1ca18251004c73afef6255b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / shesha_geometry-0.3.0-py3-none-any.whl

Download URL shesha_geometry-0.3.0-py3-none-any.whl
Size 45.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea19c93f898ca43d50fbe9dfe3110350463b45169fc7abad9824315de21d2542
BLAKE2b-256 checksum
How to use checksums
53894072f4b465c6df44e18f8d761a8b4ed7c7fe84d96b86de6ab5af12057b5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for shesha-geometry 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shesha_geometry-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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