pyFM.spectral.projection_utils.mycdist¶
- pyFM.spectral.projection_utils.mycdist(X, Y, sqnormX=None, sqnormY=None, squared=False)¶
Compute pairwise euclidean distance between two collections of vectors in a k-dimensional space.
- Parameters:
X ((n1, k) np.ndarray) – First collection.
Y ((n2, k) or (k,) np.ndarray) – Second collection, or (k,) if a single point.
sqnormX ((n1,) np.ndarray, optional) – Precomputed squared norms of the rows of X. Computed on the fly if None.
sqnormY ((n2,) np.ndarray or float, optional) – Precomputed squared norms of the rows of Y (or scalar norm if Y is a single point). Computed on the fly if None.
squared (bool, optional) – Whether to compute the squared euclidean distance.
- Returns:
distmat – Distance matrix.
- Return type:
(n1, n2) or (n2,) np.ndarray