polars-umap
UMAP dimensionality reduction as a Polars plugin.
import polars as pl
import polars_umap # registers the `umap` namespace
df.with_columns(xy=pl.col("embedding").umap.fit_transform(metric="cosine"))
polars-umap runs UMAP (Uniform Manifold Approximation and Projection) directly inside Polars expressions. It is powered by the Rust ports of umap-learn and PyNNDescent from Apple's embedding-atlas.
- Native Polars: works on
Array/Listembedding columns or plain numeric columns, in eager and lazy mode, and per group with.over()orgroup_by().agg(). - Fast: 2–12× faster than umap-learn, with no JIT warm-up and optional GPU acceleration.
- Faithful: reproduces the umap-learn 0.6 pipeline by default, or the classic 0.5 pipeline. Embedding quality matches umap-learn.
- Reproducible: with a
random_state, results are bit-identical regardless of the number of threads. - Small footprint: one wheel that depends only on Polars. Supports Python ≥ 3.9 and Polars ≥ 1.0.
Documentation: https://polars-umap.jeroenjanssens.com/
Installation
uv add polars-umap
# or
pip install polars-umap
Quickstart
import polars as pl
import polars_umap as pu
from sklearn.datasets import load_digits
X, y = load_digits(return_X_y=True)
df = pl.DataFrame({"pixels": X, "digit": y}) # pixels: Array(Float64, 64)
# Expression API: returns an Array(Float32, 2) column
df.with_columns(xy=pl.col("pixels").umap.fit_transform(random_state=42))
# DataFrame API: adds umap_0 and umap_1 columns
df.umap.fit_transform("pixels", random_state=42)
A taste of the API
# Several numeric columns, stacked into a feature matrix (selectors work too)
pu.umap("sepal_length", "sepal_width", "petal_length", "petal_width")
# One UMAP per group, in a single query
pl.col("embedding").umap.fit_transform(random_state=0).over("category")
# Fit on the valid rows, return null for rows with null/NaN values
pl.col("embedding").umap.fit_transform(null_policy="ignore")
# Approximate nearest neighbors, and UMAP on a precomputed graph
pl.col("embedding").umap.knn(k=15, metric="cosine")
pu.umap_from_knn("indices", "distances")
The user guide covers these in depth, along with choosing parameters, reproducibility and performance. The examples include a Quarto report and an interactive marimo notebook.
Benchmarks
- 2–12× faster than umap-learn, with the same trustworthiness, kNN recall and label accuracy. This excludes umap-learn's 10–12 s numba warm-up.
- No measurable overhead from Polars: polars-umap is as fast as the raw upstream Rust binary.
.over()with 1,000 groups: 18 s, against 58 s for a Python loop.
See the benchmarks page for all results and the methodology.
Limitations
The upstream implementation only fits, so there is no transform() for new points. Supervised UMAP,
densMAP and sparse input aren't supported either.
Contributing
See CONTRIBUTING.md for how to build, test and benchmark polars-umap, and how to build the documentation.
Acknowledgements
The algorithms are implemented by Apple's embedding-atlas (MIT), which ports umap-learn and PyNNDescent by Leland McInnes. Please cite the UMAP paper if you use this in research:
McInnes, L., Healy, J., & Melville, J. (2018). UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction. arXiv:1802.03426.
License
Metadata
Release files for polars-umap 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polars_umap-0.1.0.tar.gz | 58.9 kB | Without provenance | Details for polars_umap-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 53.8 MB
Release files / polars_umap-0.1.0.tar.gz
| Download URL | polars_umap-0.1.0.tar.gz |
|---|---|
| Size | 58.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ceb1182073ad6d58d9ea865dcf48dfe505ab04a4fd3bc8fc321bd62183c66690
|
|
BLAKE2b-256 checksum How to use checksums |
acb0844ac24da1a573592cc0efa224ba720bac3c62fc6c6b837c93c6cedc833b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-win_amd64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
461f3028d6a8944061aa13d1ef129390bf1200b80d795dfb5596d33c836d9a6b
|
|
BLAKE2b-256 checksum How to use checksums |
5aa18f9c2876dfc46a2a7bd16191e10f457998892abed1a0326a7f1fc89a9285
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 8.1 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ff935619687176b821f4462c185c804b2f2e1b029b60d287b3a21c3d1fcb97f2
|
|
BLAKE2b-256 checksum How to use checksums |
906eb021e7f92e7f59af54541bc50defd1b711a7a224f69b0adc7250eb733638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 7.6 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
345fa1bc6c712a8ce738c49cab497433357ecdb6f6c15911ec8280a92679194d
|
|
BLAKE2b-256 checksum How to use checksums |
b4ffb332b591a75a364c446e413b22650a5429ad54e1917611a0c7c81af9ed94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 7.9 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
71a96e6733fcb60896be0d0c6daa1475eb74b02a3e642682c204f9e39d3abc29
|
|
BLAKE2b-256 checksum How to use checksums |
21fba5780b45d87e1c41622fcf204ec635526805c7f180ffb7d7cee0ea038e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
35ab8e93ff4614b933126bc51818a26fa5bc75c762590858b52ba55d2433e3f3
|
|
BLAKE2b-256 checksum How to use checksums |
0f933ffed4c52b449cde566890fd34c9699b1fb9c8aaa1dd1a4c7b5459264da7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.8 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ee14c6f19d5876dab5b4bc9ba8f0bc4a3b5dcc8074a4c3d6042e79cb5ffd442
|
|
BLAKE2b-256 checksum How to use checksums |
5d8899c50d40b47d61fd396ef2a44944a6c34bfdc209728f503bb45b2ea519c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_umap-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | polars_umap-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 7.2 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
52e24ef53054d09e17e199fe95745fcb395633359eed210e6353642c0e364cc7
|
|
BLAKE2b-256 checksum How to use checksums |
c4efe921b0c5141df823879e00dd7af94513168f9281c8f8612d6559f67ce37a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for polars-umap 0.1.0
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.