Skip to content

Commit 486d24c

Browse files
authored
Better error message per issue #220
1 parent c2504c0 commit 486d24c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hdbscan/hdbscan_.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ def hdbscan(X, min_cluster_size=5, min_samples=None, alpha=1.0,
503503
min_samples = 1
504504

505505
if algorithm != 'best':
506+
if metric != 'precomputed' and issparse(X) and metric != 'generic':
507+
raise ValueError("Sparse data matrices only support algorithm 'generic'.")
508+
506509
if algorithm == 'generic':
507510
(single_linkage_tree,
508511
result_min_span_tree) = memory.cache(

0 commit comments

Comments
 (0)