packages/vaex-ml/vaex/ml/transformations.py
def fit(self, df):
        '''Fit the PCA model to the DataFrame.

        :param df: A vaex DataFrame.
        '''
        self.n_components = self.n_components or len(self.features)
        assert self.n_components >= 2, 'At least two features are required.'
        assert self.n_components <= len(self.features), 'Can not have more components than features.'
        C = df.cov(self.features, progress=self.progress)
        eigen_values, eigen_vectors = np.linalg.eigh(C)
        indices = np.argsort(eigen_values)[::-1]
        self.means_ = df.mean(self.features, progress=self.progress).tolist()
        self.eigen_vectors_ = eigen_vectors[:, indices].tolist()
        self.eigen_values_ = eigen_values[indices].tolist()
Fit the PCA model to the DataFrame.

        :param df: A vaex DataFrame.
        
Fit the PCA model to the DataFrame.
Fit the PCA model to the DataFrame .
def fit(self, df):
        self.n_components = self.n_components or len(self.features)
        assert self.n_components >= 2, 'At least two features are required.'
        assert self.n_components <= len(self.features), 'Can not have more components than features.'
        C = df.cov(self.features, progress=self.progress)
        eigen_values, eigen_vectors = np.linalg.eigh(C)
        indices = np.argsort(eigen_values)[::-1]
        self.means_ = df.mean(self.features, progress=self.progress).tolist()
        self.eigen_vectors_ = eigen_vectors[:, indices].tolist()
        self.eigen_values_ = eigen_values[indices].tolist()
def fit ( self , df ) : self . n_components = self . n_components or len ( self . features ) assert self . n_components >= 2 , 'At least two features are required.' assert self . n_components <= len ( self . features ) , 'Can not have more components than features.' C = df . cov ( self . features , progress = self . progress ) eigen_values , eigen_vectors = np . linalg . eigh ( C ) indices = np . argsort ( eigen_values ) [ : : - 1 ] self . means_ = df . mean ( self . features , progress = self . progress ) . tolist ( ) self . eigen_vectors_ = eigen_vectors [ : , indices ] . tolist ( ) self . eigen_values_ = eigen_values [ indices ] . tolist ( )
Fit the PCA model to the DataFrame.
Fit the PCA model to the DataFrame .
'''Fit the PCA model to the DataFrame.

        :param df: A vaex DataFrame.
        '''
self
df
A vaex DataFrame.
A vaex DataFrame .