kPOD
- modulo_vki.modulo.ModuloVKI.kPOD(self, M_DIST=[1, 10], k_m=0.1, cent=True, n_Modes=10, alpha=1e-06, metric='rbf', K_out=False, SAVE_KPOD=False)
Perform kernel PCA (kPOD) for snapshot data, following the VKI Machine Learning for Fluid Dynamics course.
- Parameters:
M_DIST (array-like of shape (2,), optional) – Indices of two snapshots used to estimate the minimal kernel value. These should correspond to the most distant snapshots in the dataset. Default is [1, 10].
k_m (float, optional) – Minimum value for the kernelized correlation. Default is 0.1.
cent (bool, optional) – If True, center the kernel matrix before decomposition. Default is True.
n_Modes (int, optional) – Number of principal modes to compute. Default is 10.
alpha (float, optional) – Regularization parameter for the modified kernel matrix (K_{zeta}). Default is 1e-6.
metric (str, optional) – Kernel function identifier passed to sklearn.metrics.pairwise.pairwise_kernels. Only ‘rbf’ has been tested; other metrics may require additional parameters. Default is ‘rbf’.
K_out (bool, optional) – If True, also return the full kernel matrix (K). Default is False.
SAVE_KPOD (bool, optional) – If True, save the computed kPOD results to disk. Default is False.
- Returns:
Phi_xi (ndarray of shape (n_samples, n_Modes)) – The mapped eigenvectors, that is, the principal modes in feature space.
Psi_xi (ndarray of shape (n_samples, n_Modes)) – The kPOD principal component coefficients.
Sigma_xi (ndarray of shape (n_Modes,)) – The kPOD singular values, obtained from the eigendecomposition of the centered kernel matrix.
K_zeta (ndarray of shape (n_samples, n_samples)) – The regularized and centered kernel matrix used for the decomposition. Returned only if K_out is True.
Notes
This implementation follows the hands-on tutorial from the VKI Machine Learning for Fluid Dynamics course. The kernel is computed as described in Horenko et al., Machine learning for dynamics and model reduction, arXiv:2208.07746.