source: orange/Orange/doc/modules/kmeans-silhouette.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 442 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

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