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

Skip to content

Commit 2ec8b02

Browse files
author
Eric Naeseth
committed
Internal terminology change.
1 parent 2c14ab4 commit 2ec8b02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fp_growth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self):
2121

2222
# A dictionary mapping items to the head and tail of a path of
2323
# "neighbors" that will hit every node containing that item.
24-
self._paths = {}
24+
self._routes = {}
2525

2626
def add(self, transaction):
2727
"""
@@ -45,12 +45,12 @@ def add(self, transaction):
4545
# Update the path of nodes that contain this item to include
4646
# our new node.
4747
try:
48-
path = self._paths[item]
48+
path = self._routes[item]
4949
path[1].neighbor = next_point # path[1] is the tail
5050
path[1] = next_point
5151
except KeyError:
5252
# First node for this item; start a new path.
53-
self._paths[item] = [next_point, next_point]
53+
self._routes[item] = [next_point, next_point]
5454

5555
point = next_point
5656

@@ -60,7 +60,7 @@ def nodes(self, item):
6060
"""
6161

6262
try:
63-
node = self._paths[item][0]
63+
node = self._routes[item][0]
6464
except KeyError:
6565
return
6666

0 commit comments

Comments
 (0)