

def principal_components_analysis(self, max_n_components=None):
    '\n        Returns a :map:`PCAVectorModel` with the Principal Components.\n\n        Note that the eigenvalue decomposition is applied directly on the\n        precision matrix and then the eigenvalues are inverted.\n\n        Parameters\n        ----------\n        max_n_components : `int` or ``None``, optional\n            The maximum number of principal components. If ``None``, all the\n            components are returned.\n\n        Returns\n        -------\n        pca : :map:`PCAVectorModel`\n            The PCA model.\n        '
    from .pca import PCAVectorModel
    return PCAVectorModel.init_from_covariance_matrix(C=self.precision, mean=self.mean_vector, n_samples=self.n_samples, centred=True, is_inverse=True, max_n_components=max_n_components)

dataset/ETHPy150Open menpo/menpo/menpo/model/gmrf.py GMRFVectorModel.principal_components_analysis/original