raso
Pure-Rust manifold projection and density clustering (UMAP and HDBSCAN, with t-SNE, Python abi3, and WASM bindings planned).
Raso (Spanish: flat, level, open, unobstructed) is about flattening high-dimensional embeddings into a 2D/3D plane where structure and clusters become legible.
Workspace crates
| Crate | Purpose |
|---|---|
raso |
Umbrella facade re-exporting sub-crates behind feature flags (umap, hdbscan, parallel) |
raso-umap |
Pure-Rust UMAP dimensionality reduction |
raso-hdbscan |
Pure-Rust HDBSCAN density-based clustering (EOM and Leaf selection, membership probabilities, persistence) |
Implementation scope (80/20 UMAP)
raso-umap currently implements a clean, intentionally simple 80/20 UMAP:
- Exact brute-force $O(n^2)$ k-NN search (fast and exact for small-to-medium datasets up to ~10k points; avoids NN-Descent complexity for now)
- Smooth k-NN fuzzy simplicial set construction
- Curve-fitted $(a, b)$ parameters and negative-sampling SGD layout optimization
- Out-of-sample
transformvia weighted k-NN initialization + SGD refinement
raso-hdbscan implements core distances, mutual-reachability MST, condensed tree construction, EOM/Leaf cluster extraction, soft membership probabilities, and cluster persistence.
Usage
Add the umbrella crate (or a single member crate like raso-umap / raso-hdbscan) from GitHub:
[]
= { = "https://github.com/mmacpherson/raso" }
= "0.16"
use array;
use ;
use ;
let data = array!;
let coords = new
.n_neighbors
.n_components
.min_dist
.metric
.random_state
.fit_transform?;
let clusters = new
.min_cluster_size
.metric
.fit?;
Single-threaded & wasm32-unknown-unknown
rayon parallelism is enabled by default via the parallel feature. Disable it for single-threaded or WebAssembly builds without SharedArrayBuffer / COOP+COEP headers:
[]
= { = "https://github.com/mmacpherson/raso", = false, = ["umap", "hdbscan"] }
Development
Roadmap
raso-tsnecratebindings/python(PyO3abi3-py311wheels for Python 3.11–3.15+)bindings/wasm(wasm-bindgenpackage for browser-side projection and clustering)- Approximate k-NN (NN-Descent) for larger datasets in
raso-umap
License
MIT — see LICENSE.