From 215ef9b06fc47abf816459e42eec77f5e865ad62 Mon Sep 17 00:00:00 2001 From: Marko Toplak Date: Thu, 26 Oct 2023 14:10:35 +0200 Subject: [PATCH] dask PCA: use incremental PCA for better memory efficieny --- Orange/projection/pca.py | 3 ++- Orange/tests/test_pca.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Orange/projection/pca.py b/Orange/projection/pca.py index 717c848f1d5..c16e2f27179 100644 --- a/Orange/projection/pca.py +++ b/Orange/projection/pca.py @@ -285,8 +285,9 @@ def _initialize_wrapped(self, X=None, Y=None): else: if params["iterated_power"] == "auto": params["iterated_power"] = 0 + params.pop("tol") - return dask_decomposition.PCA(**params) + return dask_decomposition.IncrementalPCA(**params) return self.__wraps__(**params) diff --git a/Orange/tests/test_pca.py b/Orange/tests/test_pca.py index b3dc3f6a159..36da70c471f 100644 --- a/Orange/tests/test_pca.py +++ b/Orange/tests/test_pca.py @@ -159,9 +159,8 @@ def test_improved_randomized_pca_sparse_data(self): @unittest.skipIf(sklearn_version.startswith('0.20'), "https://github.com/scikit-learn/scikit-learn/issues/12234") - @with_dasktable - def test_incremental_pca(self, prepare_table): - data = prepare_table(self.ionosphere) + def test_incremental_pca(self): + data = self.ionosphere self.__ipca_test_helper(data, n_com=3, min_xpl_var=0.49) self.__ipca_test_helper(data, n_com=32, min_xpl_var=1)