From 6970ec8f09bd146df87ec010a8551d1629249c0b Mon Sep 17 00:00:00 2001 From: holger Date: Sat, 22 Jan 2022 13:27:08 +0100 Subject: [PATCH] code cleanup --- KMeansBase/KMeans.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/KMeansBase/KMeans.cs b/KMeansBase/KMeans.cs index 71cfc22..3093496 100644 --- a/KMeansBase/KMeans.cs +++ b/KMeansBase/KMeans.cs @@ -43,7 +43,6 @@ public static class KMeans { foreach (var point in points) { - var id = 0; var distance = double.MaxValue; foreach (var centroid in centroids) { @@ -51,10 +50,8 @@ public static class KMeans var currentDistance = Distance(centroid, point); if (currentDistance > distance) continue; distance = currentDistance; - id = centroid.ClusterId; + point.ClusterId = centroid.ClusterId; } - - point.ClusterId = id; } }