sc: Separation/Compactness Ratio

View source: R/sc.R

scR Documentation

Separation/Compactness Ratio

Description

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

Usage

sc(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 formula of Separation-Compactness (SC) index is:

I_{SC}= SC_1 - SC_2

In the above equation:

SC_1 is a measure of fuzzy separation and is calculated as follows:

SC_1 = \frac{∑\limits_{j=1}^k ||\vec{v}_j - \bar{v}||^2/k}{∑\limits_{j=1}^k \Big(∑\limits_{i=1}^n (u_{ij})^m ||\vec{x}_i - \vec{v}_j||^2 / ∑\limits_{i=1}^n u_{ij} \Big)}

SC_2 is a measure of fuzzy compactness and is calculated as follows:

SC_2 = \frac{∑\limits_{j=1}^{k-1} ∑\limits_{l=1}^{k-j} \Big( ∑\limits_{i=1}^n (min(u_{ij}, u_{il})^2 / n_{jz} \Big)}{∑\limits_{i=1}^n \max\limits_{1 ≤q j ≤q k} (u_{ij})^2 / ∑\limits_{i=1}^n \max\limits_{1 ≤q j ≤q k} u_{ij}}

Where: z=j+l.

Larger values of SC_1 indicate that the fuzzy partition is considered well-separated and compact while smaller values of SC_2 indicate compact and well-separated fuzzy clusters correspond to the partioning. The maximum of I_{SC} is expected to detect well-defined fuzzy partition (Zahid et al, 1999).

Value

sc

SC index value if tidx is ‘f’

sc.e

extended SC index value if tidx is ‘e’

sc.g

generalized SC index value if tidx is ‘g’

Author(s)

Zeynel Cebeci

References

Zahid, N., Limouri, M. & Essaid, A. (1999). A new cluster-validity for fuzzy clustering. Pattern Recognition, 32(7): 1089-1097. <doi:10.1016/S0031-3203(98)00157-5>

See Also

allindexes, apd, cl, cs, 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 SC index using res.fcm, which is a ppclust object
idx <- sc(res.fcm)
print(idx)
 
# Compute the SC index using X, U and V matrices
idx <- sc(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 XB index using res.upfc, which is a ppclust object
idx <- sc(res.upfc, tidx="g")
print(idx)

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