7a230980914c8a0223f0e04a54c9e6f240358e05,tslearn/clustering.py,KShape,_fit_one_init,#KShape#Any#Any#,741

Before Change


        if hasattr(self.init, "__array__"):
            self.cluster_centers_ = self.init.copy()
        else:
            self.cluster_centers_ = rs.randn(self.n_clusters, sz, d)
        self._norms_centroids = numpy.linalg.norm(self.cluster_centers_, axis=(1, 2))
        if hasattr(self.init, "__array__"):
            self._assign(X)
        else:

After Change


            self.cluster_centers_ = self.init.copy()
        elif self.init == "random":
            indices = rs.choice(X.shape[0], self.n_clusters)
            self.cluster_centers_ = X[indices].copy()
        else:
            raise ValueError("Value %r for parameter "init" is invalid" % self.init)
        self._norms_centroids = numpy.linalg.norm(self.cluster_centers_, axis=(1, 2))
        self._assign(X)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: rtavenar/tslearn
Commit Name: 7a230980914c8a0223f0e04a54c9e6f240358e05
Time: 2019-02-07
Author: romain.tavenard@univ-rennes2.fr
File Name: tslearn/clustering.py
Class Name: KShape
Method Name: _fit_one_init


Project Name: nipy/dipy
Commit Name: 0742b80f3c175de082127ee73a7364e173fd60df
Time: 2014-09-30
Author: jomaroceguedag@gmail.com
File Name: dipy/align/tests/test_sumsqdiff.py
Class Name:
Method Name: test_compute_residual_displacement_field_ssd_2d


Project Name: nipy/dipy
Commit Name: 0742b80f3c175de082127ee73a7364e173fd60df
Time: 2014-09-30
Author: jomaroceguedag@gmail.com
File Name: dipy/align/tests/test_sumsqdiff.py
Class Name:
Method Name: test_compute_residual_displacement_field_ssd_3d