8000 Merge pull request #4266 from lesteve/python3-fix-plot-kmeans-silhoue… · scikit-learn/scikit-learn@3d86d1f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d86d1f

Browse files
committed
Merge pull request #4266 from lesteve/python3-fix-plot-kmeans-silhouette-analysis
[MRG] python 3 fix in plot_kmeans_silhouette_analysis.py
2 parents f20ff86 + 7b24628 commit 3d86d1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/cluster/plot_kmeans_silhouette_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@
117117
ax1.set_xticks([-0.1, 0, 0.2, 0.4, 0.6, 0.8, 1])
118118

119119
# 2nd Plot showing the actual clusters formed
120+
colors = cm.spectral(cluster_labels.astype(float) / n_clusters)
120121
ax2.scatter(X[:, 0], X[:, 1], marker='.', s=30, lw=0, alpha=0.7,
121-
c=map(cm.spectral, cluster_labels.astype(float) / n_clusters))
122+
c=colors)
122123

123124
# Labeling the clusters
124125
centers = clusterer.cluster_centers_

0 commit comments

Comments
 (0)
0