rankkmed | R Documentation |
This function runs the rank k-medoids algorithm proposed by Zadegan et. al. (2013).
rankkmed(distdata, ncluster, m = 3, iterate = 10, init = NULL)
distdata |
A distance matrix (n x n) or dist object. |
ncluster |
A number of clusters. |
m |
A number of objects to compute hostility (see Details). |
iterate |
A number of iterations for the clustering algorithm. |
init |
A vector of initial objects as the cluster medoids (see Details). |
This algorithm is claimed to cope with the local optima problem
of the simple and fast-kmedoids algorithm (fastkmed
). The
m
argument is defined by the user and has to be 1 < m ≤q n.
The m
is a hostility measure computed by
m_i = ∑_{X_j \in Y} r_{ij}
where x_j is the object j, Y is the set of objects as many as m, and r_{ij} is the rank distance, i.e. sorted distance, between object i and j.
init
can be provided with a vector of id objects. The length of
the vector has to be equal to the number of clusters. However, assigning
a vector in the init
argument, the algorithm is no longer the rank
k-medoids algorithm.
Function returns a list of components:
cluster
is the clustering memberships result.
medoid
is the id medoids.
minimum_distance
is the distance of all objects to their cluster
medoid.
Weksi Budiaji
Contact: budiaji@untirta.ac.id
Zadegan, S.M.R, Mirzaie M, and Sadoughi, F. 2013. Ranked k-medoids: A fast and accurate rank-based partitioning algorithm for clustering large datasets. Knowledge-Based Systems 39, 133-143.
num <- as.matrix(iris[,1:4]) mrwdist <- distNumeric(num, num, method = "mrw") result <- rankkmed(mrwdist, ncluster = 3, iterate = 50) table(result$cluster, iris[,5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.