Generates the kNN graph
rs_sc_knn.RdThis function is a wrapper over the Rust-based generation of the approximate nearest neighbours. You have several options to get the approximate nearest neighbours:
"annoy": leverages binary trees to generate rapidly in a parallel manner an index. Good compromise of index generation, querying speed."hnsw": uses a hierarchical navigatable small worlds index under the hood. The index generation takes more long, but higher recall and ideal for very large datasets due to subdued memory pressure."nndescent": an index-free approximate nearest neighbour algorithm that is ideal for small, ephemeral kNN graphs.
Arguments
- embd
Numerical matrix. The embedding matrix to use to generate the kNN graph.
- knn_params
List. The kNN parameters defined by
params_sc_neighbours().- verbose
Boolean. Controls verbosity of the function and returns how long certain operations took.
- seed
Integer. Seed for reproducibility purposes.