source: orange/orange/doc/Orange/rst/code/kmeans-silhouette.py @ 7130:12a00963a5e8

Revision 7130:12a00963a5e8, 442 bytes checked in by markotoplak, 3 years ago (diff)

Added Makefile for doc/Orange.

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