source: orange/Orange/testing/regression/tests_20/modules_kmeans-silhouette.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 442 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.