Skip to content

Instantly share code, notes, and snippets.

@Minsq
Minsq / apriori_toy.py
Created June 1, 2018 03:20 — forked from Stiivi/apriori_toy.py
Data toy: Apriori algorithm in Python
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: