Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d37e7e1

Browse files
author
Eric Naeseth
committed
Better explain that items need to be hashable.
1 parent 3d7347d commit d37e7e1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ in your transactions with the following code:
2727
print itemset
2828
2929
Note that `find_frequent_itemsets` returns a generator of itemsets, not a
30-
greedily-populated list.
30+
greedily-populated list. Each item must be hashable (i.e., it must be valid as
31+
a member of a dictionary or a set).
3132

3233
Script Usage
3334
------------

fp_growth.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def find_frequent_itemsets(transactions, minimum_support):
2424
The `transactions` parameter can be any iterable of iterables of items.
2525
`minimum_support` should be an integer specifying the minimum number of
2626
occurrences of an itemset for it to be accepted.
27+
28+
Each item must be hashable (i.e., it must be valid as a member of a
29+
dictionary or a set).
2730
"""
2831
items = defaultdict(lambda: 0) # mapping from items to their supports
2932
processed_transactions = []

0 commit comments

Comments
 (0)