View source: R/clusters_MajKm.R
clusters_MajKm | R Documentation |
clusters data into two clusters with a majorization k-means This functionis use a hybrid of the k-means and the majorizaion-minimazation method to cluster the data and exports the clustering results as well as the sum of square (SS) of clustering
clusters_MajKm(X, k = 2, La)
X |
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)) |
k |
number of clusters ( this version considers 2 clusters ) |
La |
the tunnung parameter |
sum of square (SS) of clustring and the 'delta' (difference of two successive majorization function).
{
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),]
clusters_MajKm(X,2, 0.5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.