
Parameters for single cell kNN searches
params_sc_knn.RdParameters for single cell kNN searches
Usage
params_sc_knn(
k = 15L,
knn_method = c("kmknn", "hnsw", "annoy", "nndescent", "ivf", "exhaustive"),
ann_dist = c("euclidean", "cosine"),
n_trees = 50L,
search_budget = NULL,
delta = 0.001,
diversify_prob = 0,
ef_budget = NULL,
extract_knn = FALSE,
m = 16L,
ef_construction = 200L,
ef_search = 100L,
n_list = NULL,
n_probe = NULL
)Arguments
- k
Integer. Number of neighbours. Defaults to
15L.- knn_method
String. Which method to use for the approximate nearest neighbour search. One of
c("kmknn", "hnsw", "annoy", "nndescent", "ivf", "exhaustive"). Defaults to"kmknn".- ann_dist
String. Distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".- n_trees
Integer. Annoy param: number of trees. Defaults to
50L.- search_budget
Integer or
NULL. Annoy param: optional search budget per tree. IfNULL, defaults ton_trees * k * 20Linternally. Defaults toNULL.- delta
Numeric. NNDescent param: early termination criterion. Defaults to
0.001.- diversify_prob
Numeric. NNDescent param: diversification probability applied at the end of index construction. Defaults to
0.0.- ef_budget
Integer or
NULL. NNDescent param: optional query budget. Higher values improve recall at the cost of speed. Defaults toNULL.- extract_knn
Boolean. NNDescent param: hand back the graph the descent already built instead of beam searching it. Skips the query pass entirely, so it is much faster, at the cost of some recall. Rows the descent never filled come back padded with duplicate edges. Ignored by every other method. Defaults to
FALSE.- m
Integer. HNSW param: number of connections between layers. Defaults to
16L.- ef_construction
Integer. HNSW param: size of the dynamic candidate list during construction. Defaults to
200L.- ef_search
Integer. HNSW param: size of the candidate list at query time. Higher values improve recall at the cost of speed. Defaults to
100L.- n_list
Integer or
NULL. IVF param: number of clusters to generate. IfNULL, defaults tosqrt(n)internally. Defaults toNULL.- n_probe
Integer or
NULL. IVF param: number of clusters to query. IfNULL, defaults tosqrt(n_list)internally. Defaults toNULL.
Value
A named list with the following elements:
k - Integer. Number of neighbours. Defaults to
15L.knn_method - String. Which method to use for the approximate nearest neighbour search. One of
c("kmknn", "hnsw", "annoy", "nndescent", "ivf", "exhaustive"). Defaults to"kmknn".ann_dist - String. Distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".n_trees - Integer. Annoy param: number of trees. Defaults to
50L.search_budget - Integer or
NULL. Annoy param: optional search budget per tree. IfNULL, defaults ton_trees * k * 20Linternally. Defaults toNULL.delta - Numeric. NNDescent param: early termination criterion. Defaults to
0.001.diversify_prob - Numeric. NNDescent param: diversification probability applied at the end of index construction. Defaults to
0.0.ef_budget - Integer or
NULL. NNDescent param: optional query budget. Higher values improve recall at the cost of speed. Defaults toNULL.extract_knn - Boolean. NNDescent param: hand back the graph the descent already built instead of beam searching it. Skips the query pass entirely, so it is much faster, at the cost of some recall. Rows the descent never filled come back padded with duplicate edges. Ignored by every other method. Defaults to
FALSE.m - Integer. HNSW param: number of connections between layers. Defaults to
16L.ef_construction - Integer. HNSW param: size of the dynamic candidate list during construction. Defaults to
200L.ef_search - Integer. HNSW param: size of the candidate list at query time. Higher values improve recall at the cost of speed. Defaults to
100L.n_list - Integer or
NULL. IVF param: number of clusters to generate. IfNULL, defaults tosqrt(n)internally. Defaults toNULL.n_probe - Integer or
NULL. IVF param: number of clusters to query. IfNULL, defaults tosqrt(n_list)internally. Defaults toNULL.