Skip to main content

Unified dimensionality reduction on Apple Silicon: UMAP, t-SNE, PaCMAP, NNDescent, PCA - all in MLX.

Project description

mlx-vis

Dimensionality reduction on Apple Silicon. UMAP, t-SNE, PaCMAP, and NNDescent - all running on Metal via MLX.

Install

uv pip install mlx-vis

From source:

git clone --recurse-submodules https://github.com/hanxiao/mlx-vis.git
cd mlx-vis
uv pip install .

Usage

import numpy as np
from mlx_vis import UMAP, TSNE, PaCMAP, NNDescent

X = np.random.randn(10000, 128).astype(np.float32)

# UMAP
Y = UMAP(n_components=2, n_neighbors=15).fit_transform(X)

# t-SNE
Y = TSNE(n_components=2, perplexity=30).fit_transform(X)

# PaCMAP
Y = PaCMAP(n_components=2, n_neighbors=10).fit_transform(X)

# NNDescent (approximate k-NN graph)
indices, distances = NNDescent(k=15).build(X)

Submodule imports also work:

from mlx_vis.umap import UMAP
from mlx_vis.tsne import TSNE
from mlx_vis.pacmap import PaCMAP
from mlx_vis.nndescent import NNDescent

Methods

Method Class Main API Output
UMAP UMAP(n_components, n_neighbors, min_dist, ...) fit_transform(X) np.ndarray (n, d)
t-SNE TSNE(n_components, perplexity, ...) fit_transform(X) np.ndarray (n, d)
PaCMAP PaCMAP(n_components, n_neighbors, ...) fit_transform(X) np.ndarray (n, d)
NNDescent NNDescent(k, n_iters, ...) build(X) (indices, distances)

Dependencies

  • mlx >= 0.20.0
  • numpy >= 1.24.0

License

Apache-2.0

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

mlx_vis-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

mlx_vis-0.1.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file mlx_vis-0.1.0.tar.gz.

File metadata

  • Download URL: mlx_vis-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for mlx_vis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb9e861f1e6df6482658c37c17e56e8c35192e1f175bb5f1782ad75d37291140
MD5 2831875fad39f949600d568df058aa96
BLAKE2b-256 8188e4f870421c4c9612d51aefd4a4c9217d576c05a4c695dfa5add68f97b68c

See more details on using hashes here.

File details

Details for the file mlx_vis-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mlx_vis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for mlx_vis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 445ce58f70317fe1e6b5a7253315df82de2e3744406faf3f83977c07de44e1f1
MD5 abe1a495902e785e4e26e78bdb755c8b
BLAKE2b-256 1236213b19abda8acfd0b24301420eeb55b76b77df917eda65ea1ca29ab20f12

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