Skip to content

pairwise_distances

Module: strata.neighbors • Kind: function
Source: strata/neighbors/distance.mojo

def pairwise_distances[dtype: DType](
X: Matrix[dtype],
Y: Matrix[dtype],
metric: String = "euclidean",
p: Float64 = 2.0,
) -> Matrix[dtype]
def pairwise_distances[dtype: DType](
X: Matrix[dtype],
metric: String = "euclidean",
p: Float64 = 2.0,
) -> Matrix[dtype]

Overload Note: This function provides multiple overloaded signatures.

from strata.neighbors import pairwise_distances

Compute the full pairwise distance matrix between rows of X and rows of Y.

Returns: Matrix[dtype] — Matrix[dtype]: Pairwise distance matrix of shape (NX,NY)(N_X, N_Y).