7fee09aae7e913682d02892d9dd4db45ffa58c93,Orange/clustering/kmeans.py,KMeansModel,__call__,#KMeansModel#Any#,31

Before Change


        super().__init__(proj=proj, preprocessors=preprocessors)

    def __call__(self, data):
        data = self.preprocess(data)
        if isinstance(data, Table):
            c = DiscreteVariable(name="Cluster id", values=range(self.proj.get_params()["n_clusters"]))
            domain = Domain([c])
            return Table(domain, self.proj.predict(data.X).astype(int).reshape((len(data), 1)))

After Change


    def __init__(self, proj, preprocessors=None):
        super().__init__(proj=proj)

    def __call__(self, data):
        if isinstance(data, Table):
            if data.domain is not self.domain:
                data = Table(self.domain, data)
            c = DiscreteVariable(name="Cluster id", values=range(self.proj.get_params()["n_clusters"]))
            domain = Domain([c])
            return Table(domain, self.proj.predict(data.X).astype(int).reshape((len(data), 1)))
        elif isinstance(data, Instance):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: biolab/orange3
Commit Name: 7fee09aae7e913682d02892d9dd4db45ffa58c93
Time: 2015-02-27
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/clustering/kmeans.py
Class Name: KMeansModel
Method Name: __call__


Project Name: biolab/orange3
Commit Name: 7fee09aae7e913682d02892d9dd4db45ffa58c93
Time: 2015-02-27
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/clustering/dbscan.py
Class Name: DBSCANModel
Method Name: __call__


Project Name: biolab/orange3
Commit Name: 7fee09aae7e913682d02892d9dd4db45ffa58c93
Time: 2015-02-27
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/projection/cur.py
Class Name: CURModel
Method Name: __call__