pyriemann.utils.kernel.kernel_euclid

pyriemann.utils.kernel.kernel_euclid(X, Y=None, *, reg=1e-10, **kwargs)

Euclidean kernel between two sets of matrices.

Calculates the Euclidean kernel matrix \(\mathbf{K}\) of inner products of two sets \(\mathbf{X}\) and \(\mathbf{Y}\) of matrices in \(\mathbb{R}^{n \times m}\) by calculating pairwise products:

\[\mathbf{K}_{i,j} = \text{tr}(\mathbf{X}_i^T \mathbf{Y}_j)\]
Parameters:
Xndarray, shape (n_matrices_X, n, m)

First set of matrices.

YNone | ndarray, shape (n_matrices_Y, n, m), default=None

Second set of matrices. If None, Y is set to X.

regfloat, default=1e-10

Regularization parameter to mitigate numerical errors in kernel matrix estimation.

Returns:
Kndarray, shape (n_matrices_X, n_matrices_Y)

The Euclidean kernel matrix between X and Y.

See also

kernel

Notes

New in version 0.3.