Skip to main content

No project description provided

Project description

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

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

sammon-mapping-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file sammon-mapping-0.0.2.tar.gz.

File metadata

  • Download URL: sammon-mapping-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for sammon-mapping-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b32fe214e601ee2fb9af074f27f472d0ffc76010440a423f81edf63cefea12bd
MD5 dbc58d23e607163de00fb5c80737d8af
BLAKE2b-256 05149815f3e7644f27c73e21816f97e770125c67893888e3d0185025d52c83c0

See more details on using hashes here.

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