Learn R Programming

kmed (version 0.1.0)

fastkmed: Simple and fast k-medoid algorithm from Park and Jun.

Description

This function computes and returns the clustering result computed by using a specified distance via Park and Jun's algorithm.

Usage

fastkmed(distdata, ncluster, iterate = 10, init = NULL)

Arguments

distdata

A matrix of distance objects (n x n) or a diss class.

ncluster

A number of cluster.

iterate

A number of iteration for clustering algorithm.

init

An index of the initial medoids.

Value

Function returns a partitioning clustering algorithm result consists of cluster membership, cluster medoid, the minimum distance to the cluster medoid.

Details

This is a k-medoids algorithm that has been proposed by Park and Jun. The algorihm has been claimed to be fast and simple. The medoids updating in this algorihm is similar to kmeans centroid updating.

References

Park, H., Jun, C., 2009. A simple and fast algorithm for k-medoids clustering. Expert Systems with Applications 36, 3336-3341.

Examples

Run this code
# NOT RUN {
num <- as.matrix(iris[,1:4])
mrwdist <- distNumeric(num, num, method = "mrw")
result <- fastkmed(mrwdist, ncluster = 3, iterate = 50)
table(result$cluster, iris[,5])


# }

Run the code above in your browser using DataLab