skm: Simple k-medoid algorithm

Description Usage Arguments Details Value Author(s) References Examples

View source: R/skm.R

Description

This function runs the simple k-medoid algorithm proposed by Budiaji and Leisch (2019).

Usage

1
skm(distdata, ncluster, seeding = 20, iterate = 10)

Arguments

distdata

A distance matrix (n x n) or dist object.

ncluster

A number of clusters.

seeding

A number of seedings to run the algorithm (see Details).

iterate

A number of iterations for each seeding (see Details).

Details

The simple k-medoids, which sets a set of medoids as the cluster centers, adapts the simple and fast k-medoid algoritm. The best practice to run the simple and fast k-medoid is by running the algorithm several times with different random seeding options.

Value

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.

Author(s)

Weksi Budiaji
Contact: budiaji@untirta.ac.id

References

W. Budiaji, and F. Leisch. 2019. Simple K-Medoids Partitioning Algorithm for Mixed Variable Data. Algorithms Vol 12(9) 177

Examples

1
2
3
4
num <- as.matrix(iris[,1:4])
mrwdist <- distNumeric(num, num, method = "mrw")
result <- skm(mrwdist, ncluster = 3, seeding = 50)
table(result$cluster, iris[,5])

kmed documentation built on Jan. 8, 2021, 2:40 a.m.