WIP: AddGui #1

Draft
holger wants to merge 7 commits from AddGui into main
Showing only changes of commit 6970ec8f09 - Show all commits

View File

@ -43,7 +43,6 @@ public static class KMeans
{ {
foreach (var point in points) foreach (var point in points)
{ {
var id = 0;
var distance = double.MaxValue; var distance = double.MaxValue;
foreach (var centroid in centroids) foreach (var centroid in centroids)
{ {
@ -51,10 +50,8 @@ public static class KMeans
var currentDistance = Distance(centroid, point); var currentDistance = Distance(centroid, point);
if (currentDistance > distance) continue; if (currentDistance > distance) continue;
distance = currentDistance; distance = currentDistance;
id = centroid.ClusterId; point.ClusterId = centroid.ClusterId;
} }
point.ClusterId = id;
} }
} }