RepositoryJuliaUSUnited States
dillondaudert

dillondaudert/UMAP.jl

Uniform Manifold Approximation and Projection (UMAP) implementation in Julia

145stars
17forks
12issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: dimensionality-reduction

#1 Repository of the month

1
TINIX TRENDING·Topic: umap

#1 Repository of the month

2
TINIX TRENDING·Topic: julia

#2 Repository of the month

UMAP.jl

DocumentationBuild StatusTest Coverage
CI

A pure Julia implementation of the Uniform Manifold Approximation and Projection dimension reduction algorithm

McInnes, L, Healy, J, Melville, J, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction. ArXiV 1802.03426, 2018

Usage

result = UMAP.fit(data, n_components; n_neighbors, metric, ...) -> UMAP.UMAPResult
result.embedding

The fit function takes two arguments, data (either a column-major matrix or a vector of "points", e.g. vectors), n_components (the number of dimensions in the output embedding), and various keyword arguments. Several important ones are:

  • n_neighbors: This controls how many neighbors around each point are considered to be part of its local neighborhood. Larger values will result in embeddings that capture more global structure, while smaller values will preserve more local structures.
  • metric: The distance (semi-)metric to use when calculating distances between points. This can be any subtype of the SemiMetric type from the Distances.jl package, including user-defined types.
  • min_dist: This controls the minimum spacing of points in the embedding. Larger values will cause points to be more evenly distributed, while smaller values will preserve more local structure.

UMAP.fit returns a UMAPResult struct, with the output embedding at result.embedding.

Using precomputed distances

UMAP can use a precomputed distance matrix instead of finding the nearest neighbors itself. In this case, the distance matrix is passed as data and the metric keyword argument should be :precomputed. Example:

result = UMAP.fit(distances, n_components; metric=:precomputed)

Transforming new data

After embedding a dataset, we can transform new points into the same embedding space via UMAP.transform:

result = UMAP.fit(data, n_component; <kwargs>)

transform_result = UMAP.transform(result, new_data) -> UMAP.UMAPTransformResult
transform_result.embedding

Note that the type of new_data must match the original data exactly. The parameterization used for fit is re-used where appropriate in transform, via the UMAPResult struct.

Examples

The docs have more examples, e.g.

External Resources

  • Understanding UMAP
  • For a great description of how UMAP works, see this page from the Python UMAP documentation
  • If you're familiar with t-SNE, then this page describes UMAP with similar vocabulary to that dimension reduction algorithm

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
lmcinnes/umap

Uniform Manifold Approximation and Projection

8.3k
Dec 2, 2026
RepositoryJupyter Notebook
hyungkwonko/umato

Uniform Manifold Approximation with Two-phase Optimization (IEEE VIS 2022 short)

123
Feb 11, 2026
RepositoryJulia
JuliaLang/julia

The Julia Programming Language

49.3k
Dec 2, 2026
RepositoryR
jlmelville/uwot

An R package implementing the UMAP dimensionality reduction method.

371
Nov 23, 2026
RepositoryJavaScript
saehm/DruidJS

A JavaScript Library for Dimensionality Reduction

128
Nov 18, 2026
RepositoryPython
hanxiao/mlx-vis

Pure MLX implementations of UMAP, t-SNE, PaCMAP, TriMap, DREAMS, CNE, MMAE, and NNDescent for Apple Silicon. Metal GPU for computation and video rendering.

100
Mar 20, 2026
RepositoryR
jlmelville/smallvis

R package for dimensionality reduction of small datasets

73
Nov 12, 2026
RepositoryC++
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

201.9k
Dec 1, 2026
RepositoryJupyter Notebook
microsoft/ML-For-Beginners

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

92.5k
Nov 7, 2026