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

Skip to content

Commit f97a320

Browse files
author
Eric Naeseth
committed
A bit more code documentation.
1 parent 71b3f20 commit f97a320

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fp_growth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def add(self, transaction):
120120
point = next_point
121121

122122
def _update_route(self, point):
123+
"""Add the given node to the route through all nodes for its item."""
123124
assert self is point.tree
124125

125126
try:
@@ -201,6 +202,7 @@ def conditional_tree_from_paths(paths, minimum_support):
201202
for node in path:
202203
next_point = point.search(node.item)
203204
if not next_point:
205+
# Add a new node to the tree.
204206
items.add(node.item)
205207
count = node.count if node.item == condition_item else 0
206208
next_point = FPNode(tree, node.item, count)

0 commit comments

Comments
 (0)