implement kmeans/kernel kmeans