コード例 #1
0
 def test_all(self):
     basis = [
         Implication(set([acute, right]), set([equilateral, isosceles])),
         Implication(set([equilateral]), set([isosceles, acute]))
     ]
     session = self.e.create_session()
     self.assertEqual(len(session.context.objects), 3)
コード例 #2
0
ファイル: explorationtest.py プロジェクト: artreven/fca
 def test_all(self):
     basis = [
             Implication({acute, right}, {equilateral, isosceles}),
             Implication({equilateral}, {isosceles, acute})
             ]
     expert = GenericExpert(basis)
     exploration = AttributeExploration(self.db, expert)
     expert.explore(exploration)
     self.assertEqual(len(self.db._cxt.objects), 6)
     self.assertEqual(len(self.db.base), len(basis))
コード例 #3
0
ファイル: bi_unars.py プロジェクト: abramovd/explr-2
def generate_background_implications(attributes):
    return [
        Implication(set([x, y]), set([z])) for x in attributes
        for y in attributes for z in attributes
        if (x.left == z.left and x.right == y.left and y.right == z.right) or (
            x.left == z.left and x.right == y.right and y.left == z.right) or (
                x.left == y.left and x.right == z.left and y.right == z.right)
    ]
コード例 #4
0
ファイル: bi_unars.py プロジェクト: abramovd/explr-2
def get_symmetric_implication(imp):
    return Implication(get_symmetric_attribute_set(imp.premise),
                       get_symmetric_attribute_set(imp.conclusion))