Learn R Programming

UniversalCVI (version 1.2.0)

KWON.IDX: KWON index

Description

Computes the KWON (S. H. Kwon, 1998) index for a result of either FCM or EM clustering from user specified cmin to cmax.

Usage

KWON.IDX(x, cmax, cmin = 2, method = "FCM", fzm = 2, nstart = 20, iter = 100)

Value

KWON

the KWON index for c from cmin to cmax shown in a data frame where the first and the second columns are c and the KWON index, respectively.

Arguments

x

a numeric data frame or matrix where each column is a variable to be used for cluster analysis and each row is a data point.

cmax

a maximum number of clusters to be considered.

cmin

a minimum number of clusters to be considered. The default is 2.

method

a character string indicating which clustering method to be used ("FCM" or "EM"). The default is "FCM".

fzm

a number greater than 1 giving the degree of fuzzification for method = "FCM". The default is 2.

nstart

a maximum number of initial random sets for FCM for method = "FCM". The default is 20.

iter

a maximum number of iterations for method = "FCM". The default is 100.

Author

Nathakhun Wiroonsri and Onthada Preedasawakul

Details

The KWON index is defined as
$$KWON(c) = \frac{\sum_{j=1}^c\sum_{i=1}^n \mu_{ij}^2 \|{x}_i-{v}_j\|^2 +\frac{1}{c}\sum_{j=1}^c\| {v}_j-{v}_0\|^2}{\min_{i \neq j} \| {v}_i-{v}_j\|^2}. $$ The smallest value of \(KWON(c)\) indicates a valid optimal partition.

References

S. H. Kwon, “Cluster validity index for fuzzy clustering,” Electronics letters, vol. 34, no. 22, pp. 2176–2177, 1998. tools:::Rd_expr_doi("10.1049/el:19981523")

See Also

R1_data, TANG.IDX, FzzyCVIs, WP.IDX, Hvalid

Examples

Run this code

library(UniversalCVI)

# The data is from Wiroonsri (2024).
x = R1_data[,1:2]

# ---- FCM algorithm ----

# Compute the KWON index
FCM.KWON = KWON.IDX(scale(x), cmax = 15, cmin = 2, method = "FCM",
  fzm = 2, nstart = 20, iter = 100)
print(FCM.KWON)
# The optimal number of cluster
FCM.KWON[which.min(FCM.KWON$KWON),]

# ---- EM algorithm ----

# Compute the KWON index
EM.KWON = KWON.IDX(scale(x), cmax = 15, cmin = 2, method = "EM",
  nstart = 20, iter = 100)
print(EM.KWON)
# The optimal number of cluster
EM.KWON[which.min(EM.KWON$KWON),]

Run the code above in your browser using DataLab