Compute the distance matrix.
Returns the matrix of all pair-wise distances.
Parameters : | x : (M, K) array_like
y : (N, K) array_like
p : float, 1 <= p <= infinity
threshold : positive int
|
---|---|
Returns : | result : (M, N) ndarray
|
Examples
>>> distance_matrix([[0,0],[0,1]], [[1,0],[1,1]])
array([[ 1. , 1.41421356],
[ 1.41421356, 1. ]])