Skip to main content

Crate flow_knn

Crate flow_knn 

Source
Expand description

§flow-knn

Algorithm-agnostic k-nearest-neighbour graphs for large-n scientific data.

Build once with compute_knn, reuse the KnnGraph across embedders (PaCMAP, UMAP, …) without recomputing neighbours.

Structs§

HnswParams
Quality / memory trade-off for HNSW indices (usearch or ann-search-rs).
KnnGraph
Portable k-nearest-neighbour graph: per-point indices and distances only.
NeighborList
Neighbours of a single query point.
PerfRecord
One timed cell in the (n, d, method) performance matrix.
RecommendOpts
Preferences that bias automatic method choice.

Enums§

DistanceMetric
Distance metric for the KNN graph.
KnnError
KnnMethod
Approximate / exact nearest-neighbour method.
Quantization
Vector quantization for usearch HNSW storage.

Functions§

builtin_matrix
Built-in snapshot used when JSONL parse fails.
compute_knn
Compute k nearest neighbours for all n points in row-major data.
exact_knn
Exact k-NN for all n points in row-major data.
load_matrix
Load matrix: prefer path if readable, else the shipped JSONL / builtin_matrix.
parse_matrix_jsonl
Parse JSONL text into records (skips blank / comment lines).
read_knn_graph
Read a KnnGraph previously written by write_knn_graph.
recommend_method
Recommend a KnnMethod for n points of dimension d.
recommend_method_with_matrix
Same as recommend_method but with an explicit matrix (tests / custom datasets).
write_knn_graph
Write a KnnGraph to path (creates/overwrites the file).