My own K-means algorithm in R
问题 I am a beginner at R programming and I am doing this exercise in R as an intro to programming. I have made my own K means implementation in R, but have been stuck for a while at a one point: I need to make a consensus, where the algorithm iterates until it finds the optimal center of each cluster. This is the raw algorithm without iteration. It just take a random data point from the whole data as a center, which number is defined by k. Centroid_test=data[sample(nrow(data), k), ] x = Centroid