From f1a6c771167a118c0718a36cfbc6bbc2ed9d98a9 Mon Sep 17 00:00:00 2001 From: "Kruglov, Oleg" Date: Wed, 4 Sep 2024 03:01:21 -0700 Subject: [PATCH] Address comments --- onedal/spmd/decomposition/incremental_pca.py | 9 ++++++++- sklearnex/spmd/decomposition/incremental_pca.py | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/onedal/spmd/decomposition/incremental_pca.py b/onedal/spmd/decomposition/incremental_pca.py index 36100b8e70..35a9667163 100644 --- a/onedal/spmd/decomposition/incremental_pca.py +++ b/onedal/spmd/decomposition/incremental_pca.py @@ -23,6 +23,13 @@ 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" @@ -30,7 +37,7 @@ def _reset(self): 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 diff --git a/sklearnex/spmd/decomposition/incremental_pca.py b/sklearnex/spmd/decomposition/incremental_pca.py index 6540fb3c64..348e785113 100644 --- a/sklearnex/spmd/decomposition/incremental_pca.py +++ b/sklearnex/spmd/decomposition/incremental_pca.py @@ -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)