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

Skip to content

Commit 1d79a21

Browse files
author
Eric Naeseth
committed
Healthy paranoia.
1 parent 42c9856 commit 1d79a21

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fp_growth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def add(self, transaction):
115115
point = next_point
116116

117117
def _update_route(self, point):
118+
assert self is point.tree
119+
118120
try:
119121
route = self._routes[point.item]
120122
route[1].neighbor = point # route[1] is the tail
@@ -200,6 +202,8 @@ def conditional_tree_from_paths(paths, minimum_support):
200202
point.add(next_point)
201203
tree._update_route(next_point)
202204
point = next_point
205+
206+
assert condition_item is not None
203207

204208
# Calculate the counts of the non-leaf nodes.
205209
for path in tree.prefix_paths(condition_item):

0 commit comments

Comments
 (0)