59ec6660464bd378b20d4ae200c7614133a9a38b,pyntcloud/samplers/points.py,FarthestPointsSampler,compute,#FarthestPointsSampler#,54

Before Change


        solution_set.append(remaining_points.pop(
            random.randint(0, len(remaining_points) - 1)))
        for _ in range(self.n - 1):
            distances = [self.cal_distance(p, solution_set[0]) for p in remaining_points]
            for i, p in enumerate(remaining_points):
                for j, s in enumerate(solution_set):
                    distances[i] = min(distances[i], self.cal_distance(p, s))

After Change


        remaining_points = self.points.values

        // the sampled points set as the return
        select_idx = np.random.randint(low=0, high=len(self.points))
        // to remain the shape as (1, n) instead of (n, )
        solution_set = remaining_points[select_idx: select_idx+1]
        remaining_points = np.delete(remaining_points, select_idx)

        for _ in range(self.n - 1):
            distance_sum = self.cal_distance(remaining_points, solution_set)
            select_idx = np.argmax(distance_sum)
            solution_set = np.concatenate([solution_set, remaining_points[select_idx:select_idx+1]], axis=0)
            remaining_points = np.delete(remaining_points, select_idx)

        return pd.DataFrame(solution_set, columns=self.points.columns)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: daavoo/pyntcloud
Commit Name: 59ec6660464bd378b20d4ae200c7614133a9a38b
Time: 2019-08-26
Author: hc.wang96@gmail.com
File Name: pyntcloud/samplers/points.py
Class Name: FarthestPointsSampler
Method Name: compute


Project Name: r9y9/wavenet_vocoder
Commit Name: 58ad07f6e6481d909130abf2dbfe4c66f5b8d03d
Time: 2017-12-31
Author: zryuichi@gmail.com
File Name: train.py
Class Name:
Method Name: collate_fn


Project Name: arviz-devs/arviz
Commit Name: 32692a1ae53d7c5bf36564aeca1b572ddf40f9f0
Time: 2018-06-29
Author: aloctavodia@gmail.com
File Name: arviz/stats/stats.py
Class Name:
Method Name: r2_score


Project Name: Sanster/text_renderer
Commit Name: d0ef24d6c11eb50aae3b6d0ef92efe111710dbe5
Time: 2018-07-05
Author: cwq1913@gmail.com
File Name: textrenderer/corpus.py
Class Name: EngCorpus
Method Name: get_sample