@@ -96,12 +96,12 @@ def neighbors( # noqa: PLR0913
9696) -> AnnData | None :
9797 """Compute the nearest neighbors distance matrix and a neighborhood graph of observations :cite:p:`McInnes2018`.
9898
99- The neighbor search efficiency of this heavily relies on UMAP :cite:p:`McInnes2018`,
100- which also provides a method for estimating connectivities of data points -
101- the connectivity of the manifold (` method=='umap'`) .
102- If `method=='gauss'`, connectivities are computed according to :cite:t:`Coifman2005`,
103- in the adaption of :cite:t:`Haghverdi2016`.
104- If ` method=='jaccard'`, connectivities are computed as in PhenoGraph :cite:p:`Levine2015` .
99+ The computation proceeds in two independent stages.
100+ First, a k-nearest neighbor (kNN) search produces the distance matrix via the estimator passed as ``transformer``.
101+ Second, connectivities are derived from the kNN search output by the kernel selected via `` method`` .
102+ The two stages are controlled by independent parameters:
103+ ``transformer`` selects the kNN search backend,
104+ `` method`` selects the connectivity kernel .
105105
106106 .. array-support:: pp.neighbors
107107
@@ -127,12 +127,14 @@ def neighbors( # noqa: PLR0913
127127 Kernel to assign low weights to neighbors more distant than the
128128 `n_neighbors` nearest neighbor.
129129 method
130+ Kernel that derives connectivities from the kNN search output.
131+ The choice is independent of the kNN search backend,
132+ which is controlled by ``transformer``.
130133 Use 'umap' :cite:p:`McInnes2018`,
131134 'gauss' (Gauss kernel following :cite:t:`Coifman2005` with adaptive width :cite:t:`Haghverdi2016`),
132- or 'jaccard' (Jaccard kernel as in PhenoGraph, :cite:t:`Levine2015`)
133- for computing connectivities.
135+ or 'jaccard' (Jaccard kernel as in PhenoGraph, :cite:t:`Levine2015`).
134136 transformer
135- Approximate kNN search implementation following the API of
137+ kNN search backend following the API of
136138 :class:`~sklearn.neighbors.KNeighborsTransformer`.
137139 See :doc:`/how-to/knn-transformers` for more details.
138140 Also accepts the following known options:
0 commit comments