Skip to content

Commit

Permalink
Reverting K-Means ordering. It could be re-added as a post-processing…
Browse files Browse the repository at this point in the history
… step later.
  • Loading branch information
cesarsouza committed Dec 30, 2013
1 parent e9d7ae3 commit 91a54f7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Sources/Accord.MachineLearning/Clustering/KMeans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,6 @@ public int[] Compute(double[][] data, double threshold = 1e-5, bool computeInfor
centroids[i][j] = newCentroids[i][j];
}

// Reorder clusters from larger to smaller
int[] reordering = Matrix.Indices(0, k);

Array.Sort(count, reordering, new GeneralComparer(ComparerDirection.Descending));
centroids.Swap(reordering);

for (int i = 0; i < labels.Length; i++)
labels[i] = reordering[labels[i]];



for (int i = 0; i < centroids.Length; i++)
Expand Down

0 comments on commit 91a54f7

Please sign in to comment.