8ba762547a9ef06b790c207c2ba13b238ad24128,mathics/algorithm/clusters.py,_Cluster,within,#_Cluster#Any#,364

Before Change



            // s_w is the sum of within-cluster (point to its medoid) distances.
            m = self.medoid
            for i in self.members:
                if i != m:
                    s_w += distance(i, m)
                n_w += 1

                self._within = (s_w, n_w)

        return self._within

class _Medoids:
    def __init__(self, clusterer, k):

After Change


        if self._within is None:
            // s_w is the sum of within-cluster (point to its medoid) distances.
            m = self.medoid
            s_w = fsum(distance(i, m) for i in self.members if i != m)
            n_w = len(self.members)
            self._within = (s_w, n_w)

        return self._within
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: mathics/Mathics
Commit Name: 8ba762547a9ef06b790c207c2ba13b238ad24128
Time: 2016-08-22
Author: Bernhard.Liebl@gmx.org
File Name: mathics/algorithm/clusters.py
Class Name: _Cluster
Method Name: within


Project Name: Qiskit/qiskit-aqua
Commit Name: 5b01e8aea2bc83a106c9e5eb6ad3b673581fdc39
Time: 2019-04-01
Author: MATSUOA@jp.ibm.com
File Name: qiskit/aqua/translators/ising/docplex.py
Class Name:
Method Name: auto_define_penalty


Project Name: mathics/Mathics
Commit Name: 8ba762547a9ef06b790c207c2ba13b238ad24128
Time: 2016-08-22
Author: Bernhard.Liebl@gmx.org
File Name: mathics/algorithm/clusters.py
Class Name: _Medoids
Method Name: swap