Example #1
0
 def test_rule_count_p_n4(self):
     df = pd.read_csv('tests/test_files/testfile_8.csv',
                      encoding='utf-8',
                      delimiter=';')
     rule = Rule()
     ds = DictDataset(1, df)
     p, n = ds.count_p_n_rule(rule)
     self.assertEqual(16, p)
     self.assertEqual(16, n)
Example #2
0
 def test_rule_count_p_n1(self):
     df = pd.read_csv('tests/test_files/testfile_8.csv',
                      encoding='utf-8',
                      delimiter=';')
     l = Literal('ClassOfSeat', 'in', '1st')
     l2 = Literal('Age', '<', 20)
     rule = Rule()
     rule.add_literal(l)
     rule.add_literal(l2)
     ds = DictDataset(1, df)
     p, n = ds.count_p_n_rule(rule)
     self.assertEqual(1, p)
     self.assertEqual(1, n)