Skip to content

Commit d38649e

Browse files
author
Christian Bender
committed
changed variable names
1 parent 343600f commit d38649e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

algorithms/machine-learning/nearest_neighbor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ def nearest_neighbor(x, tSet):
3838
[type] -- [result of the AND-function]
3939
"""
4040
assert isinstance(x, tuple) and isinstance(tSet, dict)
41-
currentKey = ()
41+
current_key = ()
4242
MAX = 32768 # max value
43-
minD = MAX
43+
min_d = MAX
4444
for key in tSet:
4545
d = distance(x, key)
46-
if d < minD:
47-
minD = d
48-
currentKey = key
49-
return tSet[currentKey]
46+
if d < min_d:
47+
min_d = d
48+
current_key = key
49+
return tSet[current_key]
5050

5151
# Some test cases
5252

0 commit comments

Comments
 (0)