source: orange/docs/reference/rst/code/kmeans-silhouette.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 476 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1import Orange
2
3table = Orange.data.Table("voting")
4# table = Orange.data.Table("iris")
5
6for k in range(2, 8):
7    km = Orange.clustering.kmeans.Clustering(table, k, initialization=Orange.clustering.kmeans.init_diversity)
8    score = Orange.clustering.kmeans.score_silhouette(km)
9    print k, score
10
11km = Orange.clustering.kmeans.Clustering(table, 3, initialization=Orange.clustering.kmeans.init_diversity)
12Orange.clustering.kmeans.plot_silhouette(km, "kmeans-silhouette.png")
Note: See TracBrowser for help on using the repository browser.