Compute the classification error rate of two partitions.
Usage
CER(ind, true.ind,nob=length(ind))
Arguments
ind
Vector, containing the cluster labels of each case of a partition 1.
true.ind
Vector, containing the cluster labels of each case of a partition 2.
nob
The number of cases (the length of the vector ind and true ind)
Value
Return a CER value.
CER = 0 means perfect agreement between two partitions and CER = 1 means complete disagreement of two partitions.
Note: 0 <= CER <= 1
Note
This function uses comb, which generates all combinations of the elements in the vector ind.
For this reason, the function CER is not suitable for vector in a large dimension.
Author(s)
Yumi Kondo <y.kondo@stat.ubc.ca>
References
H. Chipman and R. Tibshirani. Hybrid hierarchical clustering with
applications to microarray data. Biostatistics, 7(2):286-301, 2005.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(RSKC)
Loading required package: flexclust
Loading required package: grid
Loading required package: lattice
Loading required package: modeltools
Loading required package: stats4
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RSKC/CER.Rd_%03d_medium.png", width=480, height=480)
> ### Name: CER
> ### Title: Classification Error Rate (CER)
> ### Aliases: CER
>
> ### ** Examples
>
> vec1<-c(1,1,1,2,3,3,3,2,2)
> vec2<-c(3,3,3,1,1,2,2,1,1)
> CER(vec1,vec2)
[1] 0.1388889
>
>
>
>
>
>
> dev.off()
null device
1
>