Created
October 27, 2021 22:01
-
-
Save abhijeet-talaulikar/5ffe52ae2a27ebce522ac4c5717792a6 to your computer and use it in GitHub Desktop.
get_one_itemsets.py
This file contains 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
def get_one_itemsets(transaction_db, min_sup): | |
items = {} | |
for t_tup in transaction_db.list_items: | |
for i in new_t: | |
if i in items.keys(): | |
items[i] += t_tup[1] | |
else: | |
items[i] = t_tup[1] | |
# Eliminate one itemsets which do not meet minimum support criteria | |
items = {i:sup for (i,sup) in items.items() if sup >= min_sup} | |
return items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment