Changeset 9238:b25248fc5076 in orange


Ignore:
Timestamp:
11/21/11 17:29:05 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
af86dca07fff1b74a6aa574bffeddaaa3286a1aa
Message:

Added cluster variable to Centroids output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Unsupervised/OWKMeans.py

    r9063 r9238  
    389389        for ex, midx in izip(new, km.clusters): 
    390390            ex[aid] = midx 
     391         
     392        centroids = orange.ExampleTable(domain, km.centroids) 
     393        for i, c in enumerate(centroids): 
     394            c[aid] = i 
     395            if origDomain.classVar: 
     396                c[origDomain.classVar] = "?" 
    391397 
    392398        self.send("Examples", new) 
    393         self.send("Centroids", orange.ExampleTable(km.centroids)) 
     399        self.send("Centroids", centroids) 
    394400         
    395401    def setData(self, data): 
Note: See TracChangeset for help on using the changeset viewer.