awcd: Average Within-Cluster Distance

View source: R/awcd.R

awcdR Documentation

Average Within-Cluster Distance

Description

Computes the Average Within-Cluster Distance (Krishnapuram & Freg, 1992) to validate the result of a fuzzy and/or possibilistic clustering analysis.

Usage

awcd(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

Average Within-Cluster Distance (AWCD) is defined as:

I_{AWCD}=\frac{1}{n \; k} \frac{∑\limits_{i=1}^n u_{ij}^m \; d_{ij}^2}{∑\limits_{i=1}^n u_{ij}^m}

As the I_{AWCD} monotonically decreases with the number of clusters. A knee in the curve of I_{AWCD} as a function of k indicates a good fuzzy partition.

Value

awcd

AWCD index value if tidx is ‘f’

awcd.e

extended AWCD index value if tidx is ‘e’

awcd.g

generalized AWCD index value if tidx is ‘g’

Author(s)

Zeynel Cebeci

References

Krishnapuram, R. & Freg, C. P. (1992). Fitting an unknown number of lines and planes to image data through compatible cluster merging. Pattern Recognition, 25(4):385-400. <doi:10.1016/0031-3203(92)90087-Y>

See Also

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

Examples

# Load the dataset iris
data(iris)
x <- iris[,1:4]

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

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

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