Navigating spreading-out graph. Builds an NN-Descent kNN graph of degree
knn_k first, then refines it into a sparse monotonic graph. Smallest of
the graph indices; pays for it with a double build.
References
Fu C, Xiang C, Wang C, Cai D (2019). Fast approximate nearest neighbor search with the navigating spreading-out graph. Proceedings of the VLDB Endowment, 12, 461-474. doi:10.14778/3303753.3303754
Super class
AnnIndex -> NsgIndex
Methods
Inherited methods
NsgIndex$new()
Build the index.
Arguments
dataNumeric matrix or data.frame. Samples x features. An index pointer is also accepted;
load_ann_index()uses that path.metricString. One of
c("euclidean", "sqeuclidean", "cosine", "manhattan").rInteger. Maximum out-degree of the refined graph.
l_buildInteger. Candidate list width while refining.
cInteger. Candidate pool size per node before pruning.
knn_kInteger. Degree of the NN-Descent graph built first. Wants to be comfortably above
r.ef_searchInteger or
NULL. Beam width at query time.NULLuses 100. Can be changed after the build.seedInteger. Fixes the initial graph and navigating node.
precisionString.
"float"stores the data as f32,"double"as f64..verboseBoolean. Print build progress from Rust.
Examples
x <- generate_clustered_data(1000L, 16L)$data
idx <- NsgIndex$new(x)
res <- idx$predict(x[1:5, ], k = 10L)
