rinuboney / clatern

Machine Learning in Clojure
Eclipse Public License 1.0
67 stars 12 forks source link

Add function for reassigning points to empty clusters. #26

Closed rnowling closed 9 years ago

rnowling commented 9 years ago

KMeans can produce empty clusters. To solve this, I used the same approach as scikit-learn: reassign the points with the largest distances to the empty clusters. Additionally, I removed an unnecessary variable from the KMeans main loop, refactored the cluster-assign / assign-cluster functions to remove duplicate code, and removed the acceptance condition for empty clusters in the test. Closes #3 .