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

Before Change


        if self.n > len(self.points):
            raise ValueError("n can"t be higher than the number of points in the PyntCloud.")
        remaining_points = self.points.values
        solution_set = list()
        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))
            solution_set.append(remaining_points.pop(distances.index(max(distances))))

After Change


            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: 3

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: fgnt/pb_bss
Commit Name: b6ee3d5b67fcb6903156a2b59f4a3832323adf27
Time: 2019-08-16
Author: mail@lukas-drude.de
File Name: nt/evaluation/sxr.py
Class Name:
Method Name: output_sxr


Project Name: EpistasisLab/tpot
Commit Name: 61c14212f3bc3e9be868e8c2f3f59ba53756ebf1
Time: 2016-08-08
Author: supacoofoo@gmail.com
File Name: tests.py
Class Name:
Method Name: test_combine_dfs