scib_metrics.nearest_neighbors.NeighborsResults#

class scib_metrics.nearest_neighbors.NeighborsResults(indices, distances)[source]#

Nearest neighbors results data store.

distances#

Array of distances to the nearest neighbors.

Type:

np.ndarray

indices#

Array of indices of the nearest neighbors. Self should always be included here; however, some approximate algorithms may not return the self edge.

Type:

np.ndarray

Attributes table#

knn_graph_connectivities

Compute connectivities using the UMAP approach.

knn_graph_distances

Return the sparse weighted adjacency matrix.

n_neighbors

Number of neighbors.

n_samples

Number of samples (cells).

indices

distances

Methods table#

subset_neighbors(n)

Subset down to n neighbors.

Attributes#

NeighborsResults.knn_graph_connectivities#

Compute connectivities using the UMAP approach.

Connectivities (similarities) are computed from distances using the approach from the UMAP method, which is also used by scanpy.

NeighborsResults.knn_graph_distances#

Return the sparse weighted adjacency matrix.

NeighborsResults.n_neighbors[source]#

Number of neighbors.

NeighborsResults.n_samples[source]#

Number of samples (cells).

NeighborsResults.indices: ndarray#
NeighborsResults.distances: ndarray#

Methods#

NeighborsResults.subset_neighbors(n)[source]#

Subset down to n neighbors.

Return type:

NeighborsResults