API reference¶
SPD Matrices Estimation¶
|
Estimation of covariance matrix. |
|
Estimate special form covariance matrix for ERP. |
|
Estimate special form covariance matrix for ERP combined with Xdawn. |
|
Estimation of block covariance matrix. |
|
Estimation of cospectral covariance matrix. |
|
Estimation of squared coherence matrices. |
|
Estimation of covariance matrix with time delayed Hankel matrices. |
|
Estimation of kernel matrix between channels of time series. |
|
Regularization of SPD matrices by shrinkage. |
Embedding¶
|
Perform a Locally Linear Embedding (LLE) of SPD matrices. |
|
Compute Riemannian barycenter weights of X from Y along the first axis. |
|
Spectral embedding of SPD matrices into an Euclidean space. |
|
Locally Linear Embedding (LLE) of SPD matrices. |
Classification¶
|
Classification by Minimum Distance to Mean. |
|
Classification by Minimum Distance to Mean with geodesic filtering. |
|
Classification in the tangent space. |
|
Classification by k-nearest neighbors. |
|
Classification by support-vector machine. |
|
Classification by Minimum Distance to Mean Field. |
|
Measure class distinctiveness between classes of SPD matrices. |
Regression¶
|
Regression by k-nearest-neighbors. |
|
Regression by support-vector machine. |
Clustering¶
|
Clustering by k-means with SPD matrices as inputs. |
|
Clustering by k-means for each class with SPD matrices as inputs. |
|
Artefact detection with the Riemannian Potato. |
|
Artefact detection with the Riemannian Potato Field. |
Tangent Space¶
|
Tangent space project TransformerMixin. |
|
Fisher Geodesic Discriminant analysis. |
Spatial Filtering¶
|
Xdawn algorithm. |
|
CSP spatial filtering with covariance matrices as inputs. |
|
SPoC spatial filtering with covariance matrices as inputs. |
|
Bilinear spatial filter. |
|
AJDC algorithm. |
Preprocessing¶
|
Whitening, and optional unsupervised dimension reduction. |
Channel selection¶
|
Channel selection based on a Riemannian geometry criterion. |
Finds and removes flat channels. |
Transfer Learning¶
|
Encode the domains of the matrices in the labels. |
|
Decode the domains of the matrices in the labels. |
|
Class for handling the cross-validation splits of multi-domain data. |
|
Transfer learning wrapper for estimators. |
|
Transfer learning wrapper for classifiers. |
|
Transfer learning wrapper for regressors. |
|
No transformation on data for transfer learning. |
|
Recenter data for transfer learning. |
|
Stretch data for transfer learning. |
|
Rotate data for transfer learning. |
|
Classification by Minimum Distance to Weighted Mean. |
Stats¶
|
Permutation test based on distance. |
|
Permutation test using any scikit-learn model for scoring. |
Datasets¶
|
Generate SPD dataset with two classes sampled from Riemannian Gaussian. |
|
Generate a set of outlier points. |
|
Warning DEPRECATED: make_covariances is deprecated and will be removed in 0.6.0; please use make_matrices. |
|
Generate a set of matrices, with specific properties. |
|
Generate a set of masks, defined as semi-orthogonal matrices. |
|
Sample a Riemannian Gaussian distribution. |
|
Generate a random SPD matrix. |
|
Generate source and target toy datasets for transfer learning examples. |
Utils function¶
Utils functions are low level functions that implement most base components of Riemannian Geometry.
Covariance preprocessing¶
|
Estimation of covariance matrix. |
|
Robust M-estimators. |
Schaefer-Strimmer shrunk covariance estimator. |
|
|
Sample covariance estimator. |
|
Special form covariance matrix, concatenating a prototype P. |
|
Special form covariance matrix, embedding input X. |
|
Compute block diagonal covariance. |
|
Compute the complex cross-spectral matrices of a real signal X. |
|
Compute co-spectral matrices, the real part of cross-spectra. |
|
Compute squared coherence. |
|
Normalize a set of square matrices, using corr, trace or determinant. |
Compute non-diagonality weights of a set of square matrices. |
Distances¶
|
Distance between matrices according to a metric. |
|
Euclidean distance between matrices. |
|
Harmonic distance between invertible matrices. |
|
Kullback-Leibler divergence between SPD/HPD matrices. |
|
Symmetrized Kullback-Leibler divergence between SPD/HPD matrices. |
|
Log-det distance between SPD/HPD matrices. |
|
Log-Euclidean distance between SPD/HPD matrices. |
|
Affine-invariant Riemannian distance between SPD/HPD matrices. |
|
Wasserstein distance between SPSD/HPSD matrices. |
|
Pairwise distance matrix. |
|
Mahalanobis distance between vectors and a Gaussian distribution. |
Means¶
|
Mean of matrices according to a metric. |
|
AJD-based log-Euclidean (ALE) mean of SPD matrices. |
|
Ando-Li-Mathias (ALM) mean of SPD/HPD matrices. |
|
Mean of matrices according to the Euclidean metric. |
|
Harmonic mean of invertible matrices. |
|
Identity matrix corresponding to the matrices dimension. |
|
Mean of SPD/HPD matrices according to Kullback-Leibler divergence. |
|
Mean of SPD/HPD matrices according to the log-det metric. |
|
Mean of SPD/HPD matrices according to the log-Euclidean metric. |
|
Power mean of SPD/HPD matrices. |
|
Mean of SPD/HPD matrices according to the Riemannian metric. |
|
Mean of SPD/HPD matrices according to the Wasserstein metric. |
|
Masked Riemannian mean of SPD/HPD matrices. |
|
Riemannian NaN-mean of SPD/HPD matrices. |
Medians¶
|
Euclidean geometric median of matrices. |
|
Affine-invariant Riemannian geometric median of SPD/HPD matrices. |
Geodesics¶
|
Geodesic between matrices according to a metric. |
|
Euclidean geodesic between matrices. |
|
Log-Euclidean geodesic between SPD/HPD matrices. |
|
Affine-invariant Riemannian geodesic between SPD/HPD matrices. |
Kernels¶
|
Kernel matrix between matrices according to a specified metric. |
|
Euclidean kernel between two sets of matrices. |
|
Log-Euclidean kernel between two sets of SPD matrices. |
|
Affine-invariant Riemannian kernel between two sets of SPD matrices. |
Tangent Space¶
|
Project matrices back to manifold by Euclidean exponential map. |
|
Project matrices back to manifold by Log-Euclidean exponential map. |
|
Project matrices back to manifold by Riemannian exponential map. |
|
Project matrices in tangent space by Euclidean logarithmic map. |
|
Project matrices in tangent space by Log-Euclidean logarithmic map. |
|
Project matrices in tangent space by Riemannian logarithmic map. |
|
Return the weighted upper triangular part of matrices. |
|
Inverse upper function. |
|
Transform matrices into tangent vectors. |
|
Transform tangent vectors back to matrices. |
Base¶
|
Exponential of SPD/HPD matrices. |
|
Inverse square root of SPD/HPD matrices. |
|
Logarithm of SPD/HPD matrices. |
|
Power of SPD/HPD matrices. |
|
Square root of SPD/HPD matrices. |
|
Find the nearest SPD matrices. |
Aproximate Joint Diagonalization¶
|
Approximate joint diagonalization based on Pham's algorithm. |
|
Approximate joint diagonalization based on Jacobi angles. |
|
Approximate joint diagonalization based on UWEDGE. |
Matrix Tests¶
|
Check if matrices are square. |
|
Check if all matrices are symmetric. |
|
Check if all matrices are skew-symmetric. |
|
Check if all matrices are strictly real. |
|
Check if matrices are real type. |
|
Check if all matrices are Hermitian. |
|
Check if all matrices are positive definite (PD). |
Check if all matrices are positive semi-definite (PSD). |
|
|
Check if all matrices are symmetric positive-definite (SPD). |
Check if all matrices are symmetric positive semi-definite (SPSD). |
|
|
Check if all matrices are Hermitian positive-definite (HPD). |
Check if all matrices are Hermitian positive semi-definite (HPSD). |
Visualization¶
|
Plot 2D embedding of SPD matrices. |
|
Plot cospectral matrices. |
|
Display repetitions of a multichannel waveform. |