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. |
|
Generate a set of covariances matrices, with the same eigenvectors. |
|
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. |
|
|
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 SPD matrices according to a metric. |
|
Euclidean distance between SPD matrices. |
|
Harmonic distance between SPD matrices. |
|
Kullback-Leibler divergence between SPD matrices. |
|
Symmetrized Kullback-Leibler divergence between SPD matrices. |
|
Log-det distance between SPD matrices. |
|
Log-Euclidean distance between SPD matrices. |
|
Affine-invariant Riemannian distance between SPD matrices. |
|
Wasserstein distance between SPD matrices. |
|
Mahalanobis distance between vectors and a Gaussian distribution. |
Means¶
|
Mean of SPD matrices according to a metric. |
|
AJD-based log-Euclidean (ALE) mean of SPD matrices. |
|
Ando-Li-Mathias (ALM) mean of SPD matrices. |
|
Mean of matrices according to the Euclidean metric. |
|
Harmonic mean of SPD matrices. |
|
Identity matrix corresponding to the matrices dimension. |
|
Mean of SPD matrices according to Kullback-Leibler divergence. |
|
Mean of SPD matrices according to the log-det metric. |
|
Mean of SPD matrices according to the log-Euclidean metric. |
|
Power mean of SPD matrices. |
|
Mean of SPD matrices according to the Riemannian metric. |
|
Mean of SPD matrices according to the Wasserstein metric. |
|
Masked Riemannian mean of SPD matrices. |
|
Riemannian NaN-mean of SPD matrices. |
Medians¶
|
Euclidean geometric median of matrices. |
|
Affine-invariant Riemannian geometric median of SPD matrices. |
Geodesics¶
|
Geodesic between SPD matrices according to a metric. |
|
Euclidean geodesic between SPD matrices. |
|
Log-Euclidean geodesic between SPD matrices. |
|
Affine-invariant Riemannian geodesic between SPD matrices. |
Kernels¶
|
Kernel matrix between SPD matrices according to a specified metric. |
|
Euclidean kernel between two sets of SPD 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 SPD manifold by Euclidean exponential map. |
|
Project matrices back to SPD manifold by Log-Euclidean exponential map. |
|
Project matrices back to SPD manifold by Riemannian exponential map. |
|
Project SPD matrices in tangent space by Euclidean logarithmic map. |
|
Project SPD matrices in tangent space by Log-Euclidean logarithmic map. |
|
Project SPD matrices in tangent space by Riemannian logarithmic map. |
|
Return the weighted upper triangular part of symmetric matrices. |
|
Inverse upper function. |
|
Transform SPD matrices into tangent vectors. |
|
Transform tangent vectors back to SPD matrices. |
Base¶
|
Square root of SPD matrices. |
|
Inverse square root of SPD matrices. |
|
Exponential of SPD matrices. |
|
Logarithm of SPD matrices. |
|
Power of SPD 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 complex matrices are strictly real. |
|
Check if all matrices are Hermitian. |
|
Check if all matrices are positive definite. |
Check if all matrices are positive semi-definite. |
|
Check if all matrices are symmetric positive-definite. |
|
Check if all matrices are symmetric positive semi-definite. |
Visualization¶
|
Warning DEPRECATED: plot_confusion_matrix is deprecated and will be remove in 0.4.0; please use sklearn confusion_matrix and ConfusionMatrixDisplay; see examples/ERP/plot_classify_EEG_tangentspace.py |
|
Plot 2D embedding of SPD matrices. |
|
Plot cospectral matrices. |
|
Display repetitions of a multichannel waveform. |