Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkkruglov committed Sep 4, 2024
1 parent b751aa2 commit f1a6c77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion onedal/spmd/decomposition/incremental_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@


class IncrementalPCA(BaseEstimatorSPMD, base_IncrementalPCA):
"""
Distributed incremental estimator for PCA based on oneDAL implementation.
Allows to compute PCA distributely if data are splitted into batches.
API is the same as for `onedal.decomposition.IncrementalPCA`
"""

def _reset(self):
self._partial_result = super(base_IncrementalPCA, self)._get_backend(
"decomposition", "dim_reduction", "partial_train_result"
)
if hasattr(self, "components_"):
del self.components_

def partial_fit(self, X, queue):
def partial_fit(self, X, y=None, queue=None):
"""Incremental fit with X. All of X is processed as a single batch.
Parameters
Expand Down
7 changes: 7 additions & 0 deletions sklearnex/spmd/decomposition/incremental_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@


class IncrementalPCA(base_IncrementalPCA):
"""
Distributed incremental estimator for PCA based on sklearnex implementation.
Allows to compute PCA distributely if data are splitted into batches.
API is the same as for `sklearnex.decomposition.IncrementalPCA`
"""

_onedal_incremental_pca = staticmethod(onedalSPMD_IncrementalPCA)

0 comments on commit f1a6c77

Please sign in to comment.