# API Reference


## Functions


Build expressions that run UMAP or nearest neighbor search. They take column names, expressions or selectors.


[umap()](umap.md#polars_umap.umap)  
Embed rows into a low-dimensional space with UMAP.

[knn()](knn.md#polars_umap.knn)  
Find the approximate k nearest neighbors of every row with NNDescent.

[umap_from_knn()](umap_from_knn.md#polars_umap.umap_from_knn)  
Run UMAP on a precomputed k-nearest-neighbor graph.


## Namespaces


Importing `polars_umap` registers a `umap` namespace on `pl.Expr`, `pl.DataFrame` and `pl.LazyFrame`.


[UmapExprNamespace](UmapExprNamespace.md#polars_umap.UmapExprNamespace)  
UMAP and nearest neighbor search on an expression.

[UmapDataFrameNamespace](UmapDataFrameNamespace.md#polars_umap.UmapDataFrameNamespace)  
UMAP on a DataFrame. Available as `df.umap` after `import polars_umap`.

[UmapLazyFrameNamespace](UmapLazyFrameNamespace.md#polars_umap.UmapLazyFrameNamespace)  
UMAP on a LazyFrame. Available as `lf.umap` after `import polars_umap`.
