pyriemann.geometry.distance.pairwise_distance¶
- pyriemann.geometry.distance.pairwise_distance(X, Y=None, metric='riemann', squared=False)[source]¶
Pairwise distance matrix.
Compute the matrix of distances between pairs of elements of X and Y.
- Parameters:
- Xndarray, shape (n_matrices_X, n, n)
First set of matrices.
- YNone | ndarray, shape (n_matrices_Y, n, n), default=None
Second set of matrices. If None, Y is set to X.
- metricstring, default=”riemann”
Metric for pairwise distance. For the list of supported metrics, see
pyriemann.geometry.distance.distance().- squaredbool, default=False
Return squared distances.
Added in version 0.5.
- Returns:
- distndarray, shape (n_matrices_X, n_matrices_X) or (n_matrices_X, n_matrices_Y)
Distances between pairs of elements of X if Y is None, or between elements of X and Y.
See also
Notes
Added in version 0.2.5.
Changed in version 0.12: Add support for NumPy and PyTorch.