7f46b2274cb8958441b1236e8fd7ac39d546a732,enso/sample/__init__.py,KCenter,sample,#KCenter#,44

Before Change


                min_distances.append(new_min_point)
            new_center_point = max(min_distances,  key=lambda point_with_dist: point_with_dist.distance)
            centers.append(new_center_point.index)
            logging.info("Left to get {} for train size of {}".format(str(self.train_size - len(centers)), str(self.train_size)))
        return centers

    @property

After Change


        random_center = numpy.random.choice(self.train_indices)
        centers = [random_center]
        while len(centers) < self.train_size:
            mins = numpy.min(self.distances[centers], axis=0)
            center = numpy.argmax(mins)
            centers.append(center)
        return centers
    
    @property
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: IndicoDataSolutions/Enso
Commit Name: 7f46b2274cb8958441b1236e8fd7ac39d546a732
Time: 2017-12-13
Author: maritza@mylestone.com
File Name: enso/sample/__init__.py
Class Name: KCenter
Method Name: sample


Project Name: scikit-optimize/scikit-optimize
Commit Name: 9cdd21160f4b4352b05f7b7ce9f0f63506c585c9
Time: 2017-04-17
Author: iaroslav-ai@users.noreply.github.com
File Name: benchmarks/bench_ml.py
Class Name:
Method Name: evaluate_optimizer


Project Name: shibing624/pycorrector
Commit Name: 01e1e4475260bb6960ff96334d94ab679a876c24
Time: 2018-11-18
Author: 507153809@qq.com
File Name: pycorrector/deep_context/train.py
Class Name:
Method Name: train