From 29509d6ea0c3e5d3c5f74bfc888eafa5f8320b4a Mon Sep 17 00:00:00 2001 From: Intron7 Date: Tue, 26 Nov 2024 11:10:54 +0100 Subject: [PATCH] revert pca --- .../preprocessing/_scrublet/pipeline.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py b/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py index 711b91ca..7f52ece0 100644 --- a/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py +++ b/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py @@ -78,9 +78,9 @@ def pca( self._counts_obs_norm = self._counts_obs_norm.astype(cp.float32) self._counts_sim_norm = self._counts_sim_norm.astype(cp.float32) - pca = PCA(n_components=n_prin_comps, random_state=random_state).fit( - self._counts_obs_norm - ) - X_obs = pca.transform(self._counts_obs_norm) - X_sim = pca.transform(self._counts_sim_norm) + X_obs = _sparse_to_dense(self._counts_obs_norm) + + pca = PCA(n_components=n_prin_comps, random_state=random_state).fit(X_obs) + X_obs = pca.transform(X_obs) + X_sim = pca.transform(_sparse_to_dense(self._counts_sim_norm)) self.set_manifold(X_obs, X_sim)