rapids_singlecell icon indicating copy to clipboard operation
rapids_singlecell copied to clipboard

[neighbors] sparse matrix to ind/dist matrix pair: same as PyNNDescent?

Open flying-sheep opened this issue 8 months ago • 2 comments

We’ve been thinking about checking if Scanpy’s neighbors backends can benefit from the shortcut, but it seems like PyNNDescent behaves differently ((n_neighbors - 1) * n_obs instead of n_neighbors * n_obs)

Shouldn’t the two match up in behavior? Is this a cupy bug? I’m unsure where to harmonize this.

https://github.com/scverse/rapids_singlecell/blob/b038bcc923b4dd3d4874bae681b0f2cb919bccbf/src/rapids_singlecell/preprocessing/_neighbors.py#L131-L132

https://github.com/scverse/scanpy/blob/616d580384c1daa8115a270220aafd8c09f9f0f1/scanpy/neighbors/_common.py#L64-L81

flying-sheep avatar Oct 12 '23 09:10 flying-sheep