You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rapids_singlecell/preprocessing/_neighbors/__init__.py
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,12 @@ def neighbors(
157
157
158
158
* 'nn_descent': Uses the NN-descent algorithm to approximate the k-nearest neighbors.
159
159
160
+
* 'all_neighbors': Uses the all-neighbors algorithm to approximate the k-nearest neighbors.
161
+
162
+
* 'mg_ivfflat': Uses the Multi-GPU inverted file indexing to partition the dataset into coarse quantizer cells and performs the search within the relevant cells.
163
+
164
+
* 'mg_ivfpq': Combines Multi-GPU inverted file indexing with product quantization to encode sub-vectors of the dataset, facilitating faster distance computation.
165
+
160
166
Please ensure that the chosen algorithm is compatible with your dataset and the specific requirements of your search problem.
161
167
metric
162
168
A known metric's name or a callable that returns a distance.
@@ -171,6 +177,16 @@ def neighbors(
171
177
For 'nn_descent' algorithm, the following parameters can be specified:
172
178
* 'intermediate_graph_degree': The degree of the intermediate graph. Default is None.
173
179
It is recommended to set it to `>= 1.5 * n_neighbors`.
180
+
For 'all_neighbors' algorithm, the following parameters can be specified:
181
+
* 'algo': The algorithm to use. Valid options are: 'ivf_pq' and 'nn_descent'. Default is 'nn_descent'.
182
+
* 'n_lists': Number of inverted lists for IVF indexing. Default is 2 * next_power_of_2(sqrt(n_samples)).
183
+
* 'n_probes': Number of lists to probe during search. Default is 20. Higher values
184
+
increase accuracy but reduce speed.
185
+
For 'mg_ivfflat' and 'mg_ivfpq' algorithms, the following parameters can be specified:
186
+
* 'distribution_mode': The distribution mode to use. Valid options are: 'replicated' and 'distributed'. Default is 'replicated'.
187
+
* 'n_lists': Number of inverted lists for IVF indexing. Default is 2 * next_power_of_2(sqrt(n_samples)).
188
+
* 'n_probes': Number of lists to probe during search. Default is 20. Higher values
189
+
increase accuracy but reduce speed.
174
190
175
191
key_added
176
192
If not specified, the neighbors data is stored in .uns['neighbors'],
0 commit comments