This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import Counter | |
| from itertools import combinations | |
| def distinct_items(transactions, support=None): | |
| """Returns counted set of distinct items in transactions""" | |
| counter = Counter() | |
| for trans in transactions: | |
| counter.update(trans) | |
| if support is not None: |