sklearn parwise distances doesn't support np.matrix anymore
@@ -141,7 +141,7 @@ def sparse_binary_check(metric, sparse_binary_data):
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
