We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07bbc2a commit 62692b9Copy full SHA for 62692b9
clusterization/kmeans/kmeans.py
@@ -110,10 +110,7 @@ def _assign(self):
110
cluster_index = None
111
for ci, c in enumerate(self.clusters):
112
distance = p.distance(c.mean)
113
- if min_distance is None:
114
- min_distance = distance
115
- cluster_index = ci
116
- elif distance < min_distance:
+ if min_distance is None or distance < min_distance:
117
min_distance = distance
118
cluster_index = ci
119
tmp_clusters[cluster_index].append(p)
0 commit comments