コード例 #1
0
    def test_select_features_5(self):
        A = read_csv_metadata(path_a, key='ID')
        B = read_csv_metadata(path_b, key='ID')
        A_key = em.get_key(A)
        A_field_set = [0, 1, 2, 3]
        B_field_set = [0, 1, 2]

        A_filtered = A[A_field_set]
        B_filtered = B[B_field_set]
        db._select_features(
            A_filtered, B_filtered, A_key)
コード例 #2
0
    def test_select_features_5(self):
        A = read_csv_metadata(path_a, key='ID')
        B = read_csv_metadata(path_b, key='ID')
        A_key = em.get_key(A)
        cols_A = list(A.columns)
        cols_B = list(B.columns)

        A_field_set = [0, 1, 2, 3]
        B_field_set = [0, 1, 2]

        A_field_set = list(itemgetter(*A_field_set)(cols_A))
        B_field_set = list(itemgetter(*B_field_set)(cols_B))

        A_filtered = A[A_field_set]
        B_filtered = B[B_field_set]
        db._select_features(A_filtered, B_filtered, A_key)
コード例 #3
0
 def test_select_features_1(self):
     A = read_csv_metadata(path_a, key='ID')
     B = read_csv_metadata(path_b, key='ID')
     A_key = em.get_key(A)
     actual_selected_features = db._select_features(A, B, A_key)
     expected_selected_features = [1, 3, 4]
     self.assertEqual(actual_selected_features, expected_selected_features)
コード例 #4
0
 def test_select_features_1(self):
     A = read_csv_metadata(path_a, key='ID')
     B = read_csv_metadata(path_b, key='ID')
     A_key = em.get_key(A)
     B_key = em.get_key(B)
     actual_selected_features = db._select_features(A, B, A_key, B_key)
     expected_selected_features = [1, 3, 4, 2, 5]
     self.assertEqual(actual_selected_features, expected_selected_features)
コード例 #5
0
    def test_select_features_4(self):
        A = read_csv_metadata(path_a, key='ID')
        B = read_csv_metadata(path_b, key='ID')
        A_key = em.get_key(A)
        B_key = em.get_key(B)
        cols_A = list(A.columns)
        cols_B = list(B.columns)

        A_field_set = [0, 1, 2]
        B_field_set = [0, 1, 2, 3]

        A_field_set = list(itemgetter(*A_field_set)(cols_A))
        B_field_set = list(itemgetter(*B_field_set)(cols_B))

        A_filtered = A[A_field_set]
        B_filtered = B[B_field_set]
        db._select_features(
            A_filtered, B_filtered, A_key, B_key)
コード例 #6
0
 def test_select_features_3(self):
     A = read_csv_metadata(path_a, key='ID')
     B = read_csv_metadata(path_b, key='ID')
     A_key = em.get_key(A)
     B_key = em.get_key(B)
     corres_list = [(0, 0)]
     A_filtered, B_filtered = db._get_filtered_table(A, B, A_key, B_key, corres_list)
     actual_selected_features = db._select_features(
         A_filtered, B_filtered, A_key)
     expected_selected_features = []
     self.assertEqual(actual_selected_features, expected_selected_features)
コード例 #7
0
    def test_select_features_3(self):
        A = read_csv_metadata(path_a, key='ID')
        B = read_csv_metadata(path_b, key='ID')
        A_key = em.get_key(A)
        B_key = em.get_key(B)
        cols_A = list(A.columns)
        cols_B = list(B.columns)

        corres_list = [(cols_A[0], cols_B[0])]
        A_filtered, B_filtered = db._get_filtered_table(A, B, corres_list)
        actual_selected_features = db._select_features(
            A_filtered, B_filtered, A_key, B_key)
        expected_selected_features = []
        self.assertEqual(actual_selected_features, expected_selected_features)
コード例 #8
0
 def test_select_features_2(self):
     A = read_csv_metadata(path_a, key='ID')
     B = read_csv_metadata(path_b, key='ID')
     A_key = em.get_key(A)
     B_key = em.get_key(B)
     cols_A = list(A.columns)
     cols_B = list(B.columns)
     corres_list = [(cols_A[0], cols_B[0]), (cols_A[1], cols_B[1]), (cols_A[4],
                                                                     cols_B[4])]
     A_filtered, B_filtered = db._get_filtered_table(A, B, corres_list)
     actual_selected_features = db._select_features(
         A_filtered, B_filtered, A_key, B_key)
     expected_selected_features = [1, 2]
     self.assertEqual(actual_selected_features, expected_selected_features)