1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
From a714b59bd9e2ca2e63312bc3491b2b037a42f2f2 Mon Sep 17 00:00:00 2001
From: Leland McInnes <leland.mcinnes@gmail.com>
Date: Mon, 26 Dec 2022 17:07:07 -0500
Subject: [PATCH] sklearn parwise distances doesn't support np.matrix anymore
---
umap/tests/test_umap_metrics.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/umap/tests/test_umap_metrics.py
+++ b/umap/tests/test_umap_metrics.py
@@ -141,7 +141,7 @@
assert (
metric in spdist.sparse_named_distances
), f"{metric} not supported for sparse data"
- dist_matrix = pairwise_distances(sparse_binary_data.todense(), metric=metric)
+ dist_matrix = pairwise_distances(np.asarray(sparse_binary_data.todense()), metric=metric)
if metric in ("jaccard", "dice", "sokalsneath", "yule"):
dist_matrix[np.where(~np.isfinite(dist_matrix))] = 0.0
|