rename variable

This commit is contained in:
onyx-and-iris 2024-01-17 18:16:56 +00:00
parent adf9534443
commit c2dab280ac

View File

@ -30,10 +30,10 @@ def knn(point: Point, neighbours):
neighbour.distance = np.linalg.norm(point.array - neighbour.array)
logger.debug(f"{neighbour.identifier}: {neighbour.distance}")
average = 0
total = 0
for n in sorted(neighbours, key=lambda x: x.distance)[:K]:
average += n.sold
return average / K
total += n.sold
return total / K
neighbours = [