pyriemann.embedding.barycenter_weights¶
- pyriemann.embedding.barycenter_weights(X, Y, indices, metric='riemann', reg=0.001)¶
Compute Riemannian barycenter weights of X from Y along the first axis.
Estimates the weights to assign to each point in Y[indices] to recover the point X[i] by geodesic interpolation. The barycenter weights sum to 1.
- Parameters:
- Xndarray, shape (n_matrices, n_channels, n_channels)
Set of SPD matrices.
- Yndarray, shape (n_matrices, n_channels, n_channels)
Set of SPD matrices.
- indicesndarray, shape (n_matrices, n_neighbors)
Indices of the points in Y used to compute the barycenter
- metric{‘riemann’, ‘logeuclid’, ‘euclid’}, default=’riemann’
Kernel metric.
- regfloat, default=1e-3
Amount of regularization to add for the problem to be well-posed in the case of n_neighbors > n_channels.
- Returns:
- Bndarray, shape (n_matrices, n_neighbors)
Interpolation weights.
Notes
New in version 0.3.