Skip to main content

Module knn

Module knn 

Source
Expand description

Re-export and PaCMAP-facing adapters for flow_knn.

Structs§

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.

Functions§

builtin_matrix
Built-in snapshot used when JSONL parse fails.
compute_knn
Compute k nearest neighbours for all n points in data (n×d row-major).
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).
validate_knn_for_pacmap
Validate a graph for PaCMAP, mapping flow_knn::KnnError into PaCMAPError.
write_knn_graph
Write a KnnGraph to path (creates/overwrites the file).