8000 reverted the comment · scikit-learn/scikit-learn@8b212b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b212b9

Browse files
committed
reverted the comment
1 parent c48626c commit 8b212b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sklearn/metrics/cluster/unsupervised.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def silhouette_samples(X, labels, metric='euclidean', **kwds):
162162
B = np.array([_nearest_cluster_distance(distances[i], labels, i)
163163
for i in range(n)])
164164
sil_samples = (B - A) / np.maximum(A, B)
165+
# nan values are for clusters of size 1, and should be 0
165166
return np.nan_to_num(sil_samples)
166167

167168

0 commit comments

Comments
 (0)
0