def test_make_rules_from_iters_3(self):
     df = pd.read_csv('tests/test_files/testfile_4.csv',
                      encoding='utf-8',
                      delimiter=';')
     ds = BitmapDataset(0, df)
     rule = list()
     rule.append([1, 1])
     ds.delete_covered(rule)
     bitmap_rule = ds.make_rules_from_iters(rule)
     self.assertEqual("BitMap([])", str(bitmap_rule))
 def test_delete_covered_1(self):
     df = pd.read_csv('tests/test_files/testfile_8.csv',
                      encoding='utf-8',
                      delimiter=';')
     rule = Rule()
     ds = BitmapDataset(1, df)
     len_before = ds.length()
     ds.delete_covered(ds.unmake_rule(rule))
     len_after = ds.length()
     self.assertEqual(len_before, len_after)
 def test_rule_count_p_n5(self):
     df = pd.read_csv('tests/test_files/testfile_4.csv',
                      encoding='utf-8',
                      delimiter=';')
     l = Literal('Sex', 'in', 'Female')
     rule = Rule()
     rule.add_literal(l)
     ds = BitmapDataset(1, df)
     ds.delete_covered(ds.unmake_rule(rule))
     p, n = ds.count_p_n_rule(ds.unmake_rule(rule))
     self.assertEqual(0, p)
     self.assertEqual(0, n)
 def test_delete_covered_4(self):
     df = pd.read_csv('tests/test_files/testfile_4.csv',
                      encoding='utf-8',
                      delimiter=';')
     l = Literal('ClassOfSeat', 'in', '1st')
     rule = Rule()
     rule.add_literal(l)
     ds = BitmapDataset(1, df)
     len_before = ds.length()
     ds.delete_covered(ds.unmake_rule(rule))
     len_after = ds.length()
     self.assertEqual(len_before - 64, len_after)