pyriemann.utils.distance.distance_euclid

pyriemann.utils.distance.distance_euclid(A, B, squared=False)

Euclidean distance between matrices.

The Euclidean distance between two matrices \(\mathbf{A}\) and \(\mathbf{B}\) is defined as the Frobenius norm of the difference of the two matrices:

\[d(\mathbf{A},\mathbf{B}) = \Vert \mathbf{A} - \mathbf{B} \Vert_F\]
Parameters:
Andarray, shape (…, n, m)

First matrices, at least 2D ndarray.

Bndarray, shape (…, n, m)

Second matrices, same dimensions as A.

squaredbool, default=False

Return squared distance.

Added in version 0.5.

Returns:
dfloat or ndarray, shape (…,)

Euclidean distance between A and B.

See also

distance