Esempio n. 1
0
    def test_groups_have_less_species(self):
        original = [1,2,3,4,5]
        groups = {0:[1,2], 1:[3,4]}

        try:
            map_groups(original, groups)
        except AssertionError:
            pass
        else:
            self.fail()
def _create():
    csv, _, _ = load_train()
    named_groups = load_named_groups()
    print("Mapping species_glc_ids to groups...")
    mapped_species = map_groups(csv["species_glc_id"], named_groups)
    csv["species_glc_id"] = mapped_species
    csv.to_csv(train_with_groups, index=False)
Esempio n. 3
0
    def test1(self):
        original = [1,2,3,4]
        groups = {0:[1,2], 1:[3,4]}
        
        result = map_groups(original, groups)

        self.assertEqual(result, [0,0,1,1])
Esempio n. 4
0
    def test_groups_have_more_species(self):
        original = [1,2,3]
        groups = {0:[1,2], 1:[3,4]}
        
        result = map_groups(original, groups)

        self.assertEqual(result, [0,0,1])
Esempio n. 5
0
    def test2(self):
        original = [64,34,48,374,45,6]
        groups = {8:[64,48], 48:[34,374], 4:[45,6]}
        
        result = map_groups(original, groups)

        self.assertEqual(result, [8,48,8,48,4,4])