cs: Compactness / Separation Ratio

View source: R/cs.R

csR Documentation

Compactness / Separation Ratio

Description

Computes the Separation/Compactness (Bensaid et al, 1996) ratio index in order to validate the result of a fuzzy and/or possibilistic clustering analysis.

Usage

cs(x, u, v, m, t=NULL, eta, tidx="f")

Arguments

x

an object of class ‘ppclust’ containing the clustering results from a fuzzy clustering algorithm in the package ppclust. Alternatively, a numeric data frame or matrix containing the data set.

u

a numeric data frame or matrix containing the fuzzy membership values. It should be specified if x is not an object of ‘ppclust’.

v

a numeric data frame or matrix containing the cluster prototypes. It should be specified if x is not an object of ‘ppclust’.

t

a numeric data frame or matrix containing the cluster prototypes. It should be specified if x is not an object of ‘ppclust’ and the option e or g is assigned to tidx.

m

a number specifying the fuzzy exponent. It should be specified if x is not an object of ‘ppclust’.

eta

a number specifying the typicality exponent. It should be specified if x is not an object of ‘ppclust’ and tidx is either e or g.

tidx

a character specifying the type of index. The default is ‘f’ for fuzzy index. The other options are ‘e’ for extended and ‘g’ for generalized index.

Details

The validity-guided (re)clustering (VGC) algorithm uses cluster-validity information to guide a fuzzy (re)clustering process toward better solutions. It starts with a partition generated by a soft or fuzzy clustering algorithm. Then it iteratively alters the partition by applying split-and-merge operations to the clusters (Bensaid, 1996). The authors proposed the Compactness / Separation (CS) ratio index in order to validate the results of VGC. The formula of CS index is:

I_{CS}=∑\limits_{j=1}^k \frac{∑\limits_{i=1}^n u_{ij}^m \; d_{ij}^2}{∑\limits_{i=1}^n u_{ij} \; ∑\limits_{l=1}^k||\vec{v_j} - \vec{v_l}||^2}

A lower value of I_{CS} indicates a better clustering.

Value

cs

CS index value if tidx is ‘f’

cs.e

extended CS index value if tidx is ‘e’

cs.g

generalized CS index value if tidx is ‘g’

Author(s)

Zeynel Cebeci

References

Bensaid, A.M., Hall, L.O., Bezdek, J.C., Clarke, L.P., Silbiger, M.L., Arrington, J.A. & Murtagh, R.F. (1996). Validity-guided (re)clustering with applications to image segmentation, IEEE Transactions on Fuzzy Systems, 4(2):112-123. <10.1109/91.493905>

See Also

allindexes, apd, cl, cwb, fhv, fs, kpbm, kwon, mcd, mpc, pbm, pc, pe, si, tss, ws, xb

Examples

# Load the dataset iris and use the first four feature columns 
data(iris)
x <- iris[,1:4]

# Run FCM algorithm in the package ppclust 
res.fcm <- ppclust::fcm(x, centers=3)

# Compute the CS index using res.fcm, which is a ppclust object
idx <- cs(res.fcm)
print(idx)
 
# Compute the CS index using X, U and V matrices
idx <- cs(res.fcm$x, res.fcm$u, res.fcm$v)
print(idx)

# Run UPFCM algorithm in the package ppclust 
res.upfc <- ppclust::upfc(x, centers=3)
# Compute the generalized CS index using res.upfc, which is a ppclust object
idx <- cs(res.upfc, tidx="g")
print(idx)

zcebeci/fcvalid documentation built on Oct. 4, 2022, 9:01 p.m.