Skip to main content

Sammon Mapping

PR's Welcome PyPi Version Python Versions Version GitHub Release

Sammon mapping is a nonlinear dimensionality reduction technique that is used to represent high-dimensional data in a lower dimensional space while preserving the pairwise distances between data points as much as possible. The technique was introduced by John W. Sammon Jr. in 1969.

The Sammon Mapping algorithm tries to minimize a stress function that quantifies the difference between the pairwise distances in the original high-dimensional space and the pairwise distances in the lower dimensional space. The algorithm iteratively adjusts the positions of the data points in the lower dimensional space until the stress function is minimized.

Python Library Implementation

The sammon function in this library provides an implementation of the Sammon Mapping algorithm. The function takes the following parameters:

Function Documentation

The sammon function implements the Sammon Mapping algorithm in Python. The function takes the following parameters:

x: array-like, shape (n_samples, n_features) The input data.

n: int, optional (default: 2) The dimensionality of the output space. The default is 2.

display: int, optional (default: 0) Whether to display the iteration information or not. The default is 0.

inputdist: str, optional (default: 'raw') The type of distance metric used in the input space.

Possible values are:

  • 'raw': Euclidean distance
  • 'pcorr': Pearson correlation distance
  • 'spear': Spearman correlation distance

maxhalves: int, optional (default: 20) The maximum number of times the step halving procedure can be applied. The default is 20.

maxiter: int, optional (default: 500) The maximum number of iterations. The default is 500.

tolfun: float, optional (default: 1e-9) The tolerance for the change in the stress function. The default is 1e-9.

init: str, optional (default: 'pca') The type of initialization used for the output space.

Possible values are:

  • 'pca': Principal component analysis initialization
  • 'random': Random initialization

The function returns:

y: array-like, shape (n_samples, n_components) The transformed output data.

stress: float The final value of the stress function.

Reference

This implementation is based on the algorithm described in the following paper:

Sammon, J. W. (1969). A nonlinear mapping for data structure analysis. IEEE Transactions on Computers, C-18(5), 401-409. doi: 10.1109/T-C.1969.222678

Metadata

Release files for sammon-mapping 0.0.2

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

Source distribution (sdist)

Source distribution for sammon-mapping 0.0.2
File Size Uploaded Provenance Actions
sammon-mapping-0.0.2.tar.gz 3.4 kB Without provenance Details for sammon-mapping-0.0.2.tar.gz

Release files / sammon-mapping-0.0.2.tar.gz

Download URL sammon-mapping-0.0.2.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b32fe214e601ee2fb9af074f27f472d0ffc76010440a423f81edf63cefea12bd
BLAKE2b-256 checksum
How to use checksums
05149815f3e7644f27c73e21816f97e770125c67893888e3d0185025d52c83c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for sammon-mapping 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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