Sklearn pairwise_distances doesn't support np.matrix anymore
@@ -122,7 +122,7 @@ def sparse_spatial_check(metric, sparse_spatial_data):
assert (
metric in spdist.sparse_named_distances
), f"{metric} not supported for sparse data"
- dist_matrix = pairwise_distances(sparse_spatial_data.todense(), metric=metric)
+ dist_matrix = pairwise_distances(np.asarray(sparse_spatial_data.todense()), metric=metric)
if metric in ("braycurtis", "dice", "sokalsneath", "yule"):
dist_matrix[np.where(~np.isfinite(dist_matrix))] = 0.0
