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

Skip to content

Commit a72fe93

Browse files
author
Eric Naeseth
committed
Hacking around a reported bug.
1 parent 59a49ee commit a72fe93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fp_growth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ def conditional_tree_from_paths(paths, minimum_support):
229229
if support < minimum_support:
230230
# Doesn't make the cut anymore
231231
for node in tree.nodes(item):
232-
node.parent.remove(node)
233-
232+
if node.parent is not None:
233+
node.parent.remove(node)
234+
234235
# Finally, remove the nodes corresponding to the item for which this
235236
# conditional tree was generated.
236237
for node in tree.nodes(condition_item):

0 commit comments

Comments
 (0)