def association_rules(dataset, freqsets, support, minlift):
    nr_transactions = float(len(dataset))
    freqsets = [f for f in freqsets if len(f) > 1]
    for fset in freqsets:
        for f in fset:
            consequent = frozenset([f])
            antecendent = fset - consequent
            py_x = support[fset] / support[antecendent]
            base = support[consequent] / nr_transactions
            lift = py_x / base
            if lift > minlift:
                yield AssociationRule(antecendent, consequent, base, py_x, lift)
Testing /contacts/field/delete/(?P<field_id>\d+)
dataset/ETHPy150Open luispedro/BuildingMachineLearningSystemsWithPython/ch08/apriori/apriori.py/association_rules--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/identities/tests.py/IdentitiesViewsTest.test_contact_field_delete_out