Skip to main content

SG-t-SNE-Pi logo PySGtSNEpi

SG-t-SNE-Pi embedding demo

PyPI version Python 3.10–3.13 License: MIT CI Docs

Embed sparse graphs into 2D/3D — pure Python, pip-installable, sklearn-compatible.

PySGtSNEpi is a pure Python port of the SG-t-SNE-Pi algorithm, translated from the original C++ and Julia implementations. Unlike standard t-SNE, SG-t-SNE-Pi works on any sparse stochastic graph, not just kNN graphs derived from point clouds. No C/C++ compiler needed — pip install and go.

Features

  • 1D / 2D / 3D embedding of sparse stochastic graphs
  • Arbitrary sparse graph input — not limited to kNN graphs
  • Point cloud input with automatic kNN graph construction via PyNNDescent
  • Lambda rescaling to equalize effective node degrees
  • Scikit-learn compatible API (fit / transform / fit_transform)
  • Pure Python — runs on Windows, macOS (including Apple Silicon), and Linux
  • Numba JIT compiled hot loops for near-native speed
  • FFT-accelerated repulsive force computation

Quick Start

pip install pysgtsnepi

Scikit-learn API (point cloud)

from pysgtsnepi import SGtSNEpi

model = SGtSNEpi(d=2, lambda_=10)
Y = model.fit_transform(X)   # X is (n_samples, n_features)

Functional API (sparse graph)

from scipy.io import mmread
from pysgtsnepi import sgtsnepi

P = mmread("graph.mtx")       # sparse stochastic graph
Y = sgtsnepi(P, d=3, lambda_=10)

Roadmap

  • Lambda equalization
  • kNN graph construction (via PyNNDescent)
  • Core SG-t-SNE-Pi embedding (attractive + repulsive forces)
  • FFT-accelerated repulsive forces
  • Numba JIT for interpolation and gradient kernels
  • 1D / 3D embedding support
  • SGtSNEpi sklearn estimator class
  • sgtsnepi() functional API

Citation

If you use this package in your research, please cite:

@article{pitsianis2019joss,
  title     = {{SG-t-SNE-$\Pi$}: Swift Neighbor Embedding of Sparse Stochastic Graphs},
  author    = {Pitsianis, Nikos and Floros, Dimitris and Iliopoulos, Alexandros-Stavros and Sun, Xiaobai},
  journal   = {Journal of Open Source Software},
  volume    = {4},
  number    = {39},
  pages     = {1577},
  year      = {2019},
  doi       = {10.21105/joss.01577}
}

@inproceedings{pitsianis2019hpec,
  title     = {Spaceland Embedding of Sparse Stochastic Graphs},
  author    = {Pitsianis, Nikos and Iliopoulos, Alexandros-Stavros and Floros, Dimitris and Sun, Xiaobai},
  booktitle = {IEEE High Performance Extreme Computing Conference},
  year      = {2019},
  doi       = {10.1109/HPEC.2019.8916505}
}

Links

License

MIT — see LICENSE.

Metadata

Release files for pysgtsnepi 0.3.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 pysgtsnepi 0.3.1
File Size Uploaded
pysgtsnepi-0.3.1.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysgtsnepi 0.3.1
File Interpreter ABI Platform
pysgtsnepi-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.1 MB

Release files / pysgtsnepi-0.3.1.tar.gz

Download URL pysgtsnepi-0.3.1.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1a30e988e4bdb50e8dba28adea34fa6a1b13857399f4f7bc7d2a0816e009c288
BLAKE2b-256 checksum
How to use checksums
4835fd9f0e83efb563c9c25e940a8b95cd8412e302bee5015a709a7dff5afa4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 28, 2026.

Transparency log

Release files / pysgtsnepi-0.3.1-py3-none-any.whl

Download URL pysgtsnepi-0.3.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f5594a6d53ec0586fba99e1690fb8fdd230566d1015e49bdf34664b26a8c720
BLAKE2b-256 checksum
How to use checksums
3974e401637a1b7c1ef481ccb340568fbea1ca130708db01cb44269760a7eb6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.1

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