Skip to content

Commit

Permalink
do PCA on imputed dimensions even if data was not sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jul 5, 2018
1 parent e5d53aa commit 79f6d93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/magic/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ def transform(self, X=None, genes=None, t_max=20,

# return selected genes
if isinstance(genes, str) and genes == "pca_only":
if sparse.issparse(self.graph.data):
X_magic = PCA().fit_transform(X_magic)
X_magic = PCA().fit_transform(X_magic)
genes = ["PC{}".format(i + 1) for i in range(X_magic.shape[1])]
else:
X_magic = graph.inverse_transform(X_magic, columns=genes)
Expand Down

0 comments on commit 79f6d93

Please sign in to comment.