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 as in 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 be the most “distant” snapshots in your 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 different 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:
Psi_xi (ndarray of shape (n_samples, n_Modes)) – The kPOD principal component time coefficients.
Sigma_xi (ndarray of shape (n_Modes,)) – The kPOD singular values (eigenvalues of the centered kernel).
Phi_xi (ndarray of shape (n_samples, n_Modes)) – The mapped eigenvectors (principal modes) in feature space.
K_zeta (ndarray of shape (n_samples, n_samples)) – The (regularized and centered) kernel matrix used for decomposition. Only returned if K_out is True.
Notes
Follows the hands-on ML for Fluid Dynamics tutorial by VKI
(https://www.vki.ac.be/index.php/events-ls/events/eventdetail/552). - Kernel computed as described in Horenko et al., Machine learning for dynamics and model reduction, arXiv:2208.07746.