powered by
k-means algorithm in clustering. This function export the clustered results based on one replication of the k-means method
matrix of data (dim 1: samples (must be equal to dim 1 of X), dim 2: attributes (must be equal to dim 2 of X))
initial seleted centroids (randomly or another method)
function (in this package the distance is Euclidian)
Number of itteration function
clustered results based on k-means methods.
# NOT RUN { { X=rbind(matrix(rnorm(1000*2 ,4,.1),1000,2),matrix(rnorm(1000*2, 3, 0.2),1000,2)) M <- X[sample(nrow(X), 2),] kmeans(X,M, Euclid, 4) } # }
Run the code above in your browser using DataLab