Kmeans classifier in ruby