AccClust {UniversalCVI}R Documentation

Accuracy detection for a clustering result with known classes

Description

Computes the accuracy of a clustering result of a dataset with known classes from the k-means, fuzzy c-means, or EM algorithm.

Usage

AccClust(x, label.names = "label", algorithm = "FCM", fzm = 2,
  scale = TRUE, nstart = 100, iter = 100)

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.

label.names

a character string indicating the true label column name. The default is "label"

algorithm

a character string indicating which clustering methods to be used ("FCM", "EM", "Kmeans"). More than one methods may be selected. The default is "FCM".

fzm

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

scale

logical, if TRUE (default), the dataset is normalized before clustering.

nstart

a maximum number of initial random sets for FCM for method = "FCM" or "Kmeans" or c("Kmeans","FCM"). The default is 20.

iter

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

Value

kmeans

Accuracy score from 0 to 1 of the k-means result

FCM

Accuracy score from 0 to 1 of the FCM result

EM

Accuracy score from 0 to 1 of the EM result

Author(s)

Nathakhun Wiroonsri and Onthada Preedasawakul

References

N. Wiroonsri, O. Preedasawakul, A correlation-based fuzzy cluster validity index with secondary options detector, arXiv:2308.14785, 2023

See Also

R1_data, D1_data, FzzyCVIs, WP.IDX, XB.IDX, Hvalid

Examples


library(UniversalCVI)

# The data is from Wiroonsri (2024).
x = R1_data

# Check accuracy of clustering results obtained by kmeans, FCM, and EM clustering
AccClust(x, label.names = "label",algorithm = c("Kmeans","FCM","EM"), fzm = 2,
  scale = TRUE, nstart = 20,iter = 100)

# Check accuracy of a clustering result obtained by the FCM algoritm
AccClust(x, label.names = "label",algorithm = "FCM", fzm = 2,
  scale = TRUE, nstart = 20,iter = 100)

[Package UniversalCVI version 1.1.2 Index]