Exemple #1
0
 def test_grow_rule_1(self):
     df = pd.read_csv('tests/test_files/testfile_4.csv',
                      encoding='utf-8',
                      delimiter=';')
     ds = DictDataset(0, df)
     rule = ds.grow_rule()
     self.assertEqual("Age < 8 and Sex in ['Female']", rule.to_string())
Exemple #2
0
 def test_grow_rule_2(self):
     df = pd.read_csv('tests/test_files/mushroom.csv',
                      encoding='utf-8',
                      delimiter=';')
     ds = DictDataset(0, df)
     rule = ds.grow_rule()
     rule = ds.make_rule(rule)
     self.assertEqual("a5 in ['c', 'f', 'm', 'p', 's', 'y']",
                      rule.to_string())