
Wrapper function to generate nearest neighbour parameters
params_nn.RdWrapper function to generate nearest neighbour parameters
Usage
params_nn(
dist_metric = c("euclidean", "cosine"),
n_tree = 50L,
search_budget = NULL,
m = 16L,
ef_construction = 100L,
ef_search = 100L,
diversify_prob = 0,
delta = 0.001,
ef_budget = NULL,
extract_knn = TRUE,
bt_budget = 0.1,
n_list = NULL,
n_probes = NULL
)Arguments
- dist_metric
String. The distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".- n_tree
Integer. Number of trees for Annoy. Defaults to
50L.- search_budget
Integer or
NULL. Search budget for Annoy. Defaults toNULL.- m
Integer. Number of bidirectional links for HNSW. Defaults to
16L.- ef_construction
Integer. Size of the dynamic candidate list during HNSW construction. Defaults to
100L.- ef_search
Integer. Size of the dynamic candidate list during HNSW search. Defaults to
100L.- diversify_prob
Numeric. Diversification probability for NN descent. Defaults to
0.0.- delta
Numeric. Precision parameter for NN descent. Defaults to
0.001.- ef_budget
Integer or
NULL. Effort budget for NN descent. Ignored whenextract_knnisTRUE, as no search runs. Defaults toNULL.- extract_knn
Boolean. Only affects the
"nndescent"backend. IfTRUE, the descent hands back the graph it just built instead of running a beam search over it. Faster, at a recall of roughly0.98rather than0.99-1.00. Defaults toTRUE.- bt_budget
Numeric. Budget for ball tree search. Defaults to
0.1.- n_list
Integer or
NULL. Number of clusters to use for IVF. IfNULL, usessqrt(n). Defaults toNULL.- n_probes
Integer or
NULL. Number of clusters to probe for IVF. IfNULL, usessqrt(n_list). Defaults toNULL.
Value
A named list with the following elements:
dist_metric - String. The distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".n_tree - Integer. Number of trees for Annoy. Defaults to
50L.search_budget - Integer or
NULL. Search budget for Annoy. Defaults toNULL.m - Integer. Number of bidirectional links for HNSW. Defaults to
16L.ef_construction - Integer. Size of the dynamic candidate list during HNSW construction. Defaults to
100L.ef_search - Integer. Size of the dynamic candidate list during HNSW search. Defaults to
100L.diversify_prob - Numeric. Diversification probability for NN descent. Defaults to
0.0.delta - Numeric. Precision parameter for NN descent. Defaults to
0.001.ef_budget - Integer or
NULL. Effort budget for NN descent. Ignored whenextract_knnisTRUE, as no search runs. Defaults toNULL.extract_knn - Boolean. Only affects the
"nndescent"backend. IfTRUE, the descent hands back the graph it just built instead of running a beam search over it. Faster, at a recall of roughly0.98rather than0.99-1.00. Defaults toTRUE.bt_budget - Numeric. Budget for ball tree search. Defaults to
0.1.n_list - Integer or
NULL. Number of clusters to use for IVF. IfNULL, usessqrt(n). Defaults toNULL.n_probes - Integer or
NULL. Number of clusters to probe for IVF. IfNULL, usessqrt(n_list). Defaults toNULL.