SergioFierens/ai4r — pull request #18 by coberlin (2013-09-24 19:49:29+00:00)
Title: Added :on_empty parameter to k_means

Added :on_empty parameter to k_means clustering algorithm to allow user to choose the action to take when empty clusters arise. Options are 'eliminate' (eliminate the empty cluster, the default), 'terminate' (with error), 'random' (choose a point randomly to be the center of the replacement cluster), and 'outlier' (choose the point furthest from its centroid to be the center of the replacement cluster).