From 9e199e4820a82fb23786ce335cfedda86271be53 Mon Sep 17 00:00:00 2001 From: Leland McInnes Date: Wed, 23 May 2018 19:54:21 -0400 Subject: [PATCH] Fix for issue #71 -- sparse correlation not available in pairwise_distances --- umap/umap_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/umap_.py b/umap/umap_.py index ecee1fe5..b01e4f35 100644 --- a/umap/umap_.py +++ b/umap/umap_.py @@ -1408,7 +1408,7 @@ def fit(self, X, y=None): print("Construct fuzzy simplicial set") # Handle small cases efficiently by computing all distances - if X.shape[0] < 4096: + if X.shape[0] < 4096 and not (metric == 'correlation' and scipy.sparse.isspmatrix_csr(X)): dmat = pairwise_distances(X, metric=self.metric, **self.metric_kwds) self.graph = fuzzy_simplicial_set( dmat,