Skip to main content

Pure Python implementation of SG-t-SNE-Π: Swift Neighbor Embedding of Sparse Stochastic Graphs

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysgtsnepi-0.3.1.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysgtsnepi-0.3.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file pysgtsnepi-0.3.1.tar.gz.

File metadata

  • Download URL: pysgtsnepi-0.3.1.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysgtsnepi-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1a30e988e4bdb50e8dba28adea34fa6a1b13857399f4f7bc7d2a0816e009c288
MD5 2d58edda0f6b79862f6f03327531dd3e
BLAKE2b-256 4835fd9f0e83efb563c9c25e940a8b95cd8412e302bee5015a709a7dff5afa4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysgtsnepi-0.3.1.tar.gz:

Publisher: python-publish.yml on qqgjyx/sgtsnepi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysgtsnepi-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pysgtsnepi-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysgtsnepi-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5594a6d53ec0586fba99e1690fb8fdd230566d1015e49bdf34664b26a8c720
MD5 31d45515390595da77db62693ef54ad5
BLAKE2b-256 3974e401637a1b7c1ef481ccb340568fbea1ca130708db01cb44269760a7eb6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysgtsnepi-0.3.1-py3-none-any.whl:

Publisher: python-publish.yml on qqgjyx/sgtsnepi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page