Skip to main content

Generalizable UMAP Implementation

Project description

NUMAP

This is the official PyTorch implementation of NUMAP, a new and generalizable UMAP implementation, from the paper "Generalizable Spectral Embedding with Applications to UMAP".

NUMAP can be used to visualize many types of data in a low-dimensional space, while enabling a simple out-of-sample extension. One application of NUMAP is to visualize time-series data, and help understand the process in a given system. For example, the following figure shows the transition of a set of points from one state to another, using NUMAP. In a biological point of view, this can be viewed as a simplified simulation of the cellular differentiation process.

The package is based on UMAP and GrEASE (Generalizable and Efficient Approximate Spectral Embedding). It is easy to use and can be used with any PyTorch dataset, on both CPU and GPU. The package also includes a test dataset and a test script to run the model on the 2 Circles dataset.

The incorporation of GrEASE enables preservation of both local and global structures of the data, as UMAP, with the new capability of out-of-sample extension.

Installation

To install the package, simply use the following command:

pip install numap

Usage

The basic functionality is quite intuitive and easy to use, e.g.,

from numap import NUMAP

numap = NUMAP(n_components=2)  # n_components is the number of dimensions in the low-dimensional representation
numap.fit(X)  # X is the dataset and it should be a torch.Tensor
X_reduced = numap.transfrom(X)  # Get the low-dimensional representation of the dataset
Y_reduced = numap.transform(Y)  # Get the low-dimensional representation of a test dataset

You can read the code docs for more information and functionalities.

Running examples

In order to run the model on the 2 Circles dataset, you can either run the file, or using the command-line command:
python tests/run_numap.py
This will run NUMAP and UMAP on the 2 Circles dataset and plot the results.

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

numap-0.2.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

numap-0.2.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file numap-0.2.1.tar.gz.

File metadata

  • Download URL: numap-0.2.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for numap-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ee5496ee1a2f603abc7b34db8d8dffc89d1a12ae86efbc3cdd2a39a411829229
MD5 0d8f5238e479e8b4e64afe4201738b93
BLAKE2b-256 ce4db368a79085cfe33b938b6871b61eb820810cb5e9a89c76e2383f51f69c1f

See more details on using hashes here.

File details

Details for the file numap-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: numap-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for numap-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e98d7ef3009f41f7ba40c97f2cd5d6b52203bbe9414f08cc2cecb54e6b43852f
MD5 edf19030180f30fe0ee2705c6e571ee3
BLAKE2b-256 73d0a64dee47c251fc38a8abc5062563c8248b58f2e7a3d263ebfc4f7cd08364

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