Learn R Programming

DatabionicSwarm (version 1.2.0)

ClusteringAccuracy: ClusteringAccuracy

Description

ClusteringAccuracy

Usage

ClusteringAccuracy(PriorCls,CurrentCls,K=9)

Value

Accuracy Between zero and one

Arguments

PriorCls

[1:n] integer vector; Ground truth

CurrentCls

[1:n] integer vector with clustering result

K

Maximal number of classes for computation.

Author

Michael Thrun

Details

Here, accuracy is defined as the normalized sum over all true positive labeled data points of a clustering algorithm. The best of all permutation of labels with the highest accuracy is selected in every trial because algorithms arbitrarily define the labels.

References

Michael C. Thrun, Felix Pape, Alfred Ultsch: Benchmarking Cluster Analysis Methods in the Case of Distance and Density-based Structures Defined by a Prior Classification Using PDE-Optimized Violin Plots, ECDA, Potsdam, 2018

Examples

Run this code
data(Hepta)
# \donttest{
InputDistances=as.matrix(dist(Hepta$Data))
projection=Pswarm(InputDistances)
visualization=GeneratePswarmVisualization(Data = Hepta$Data,

projection$ProjectedPoints,projection$LC)
Cls=DBSclustering(k=7, Hepta$Data, visualization$Bestmatches,

visualization$LC,PlotIt=FALSE)
ClusteringAccuracy(Hepta$Cls,Cls,K=9)
# }
# \dontshow{
ClusteringAccuracy(Hepta$Cls,rep(1,length(Hepta$Cls)))
# }

Run the code above in your browser using DataLab