getCluster: Determining Appropriate Clusters for HCV Objects

View source: R/HCV.R

getClusterR Documentation

Determining Appropriate Clusters for HCV Objects

Description

The funciton provides two methods to determine an appropriate number of clusters for an HCV object, and reports individual cluster members. One of the method is a novel internal index named Spatial Mixture Index (SMI), considering both the within-cluster sum of squared difference of geographical attributes and non-geographical attributes. The other is an M3C-based method taking account of the stability of clusters.

Usage

getCluster(
  HCVobj,
  method = c("SMI", "M3C"),
  Kmax = 10,
  niter = 25,
  criterion = "PAC"
)

Arguments

HCVobj

an object resulting from calling the HCV function.

method

character indicating the method to determine an appropriate number of clusters. Default 'SMI' is faster, while 'M3C' is more precise but slower.

Kmax

integer for the upper bound of the potential number of clusters to be considered.

niter

integer for the number of resampling, only used in method='M3C'.

criterion

character indicating whether to use 'PAC' or 'entropy' as the objective function. Default is 'PAC'. Only used in method='M3C'. See the reference for details.

Value

A vector giving the cluster ID assigned for each sample.

Author(s)

ShengLi Tzeng and Hao-Yun Hsu.

References

John, Christopher R., et al. (2020). M3C: Monte Carlo reference-based consensus clustering. Scientific reports, 10(1), 1-14.

See Also

M3C

Examples

set.seed(0)
pcase  <-  synthetic_data(3,30,0.02,100,2,2)
HCVobj <- HCV(pcase$geo,  pcase$feat)
smi <- getCluster(HCVobj,method="SMI")
oldpar <- par(no.readonly = TRUE)  
par(mfrow=c(2,2))
labcolor  <-  (pcase$labels+1)%%3+1
plot(pcase$feat,  col  =  labcolor,  pch=19,  xlab  =  'First  attribute', 
  ylab  =  'Second  attribute',  main  =  'Feature  domain')
plot(pcase$geo,  col  =  labcolor,  pch=19,  xlab  =  'First  attribute', 
  ylab  =  'Second  attribute',  main  =  'Geometry  domain')
plot(pcase$feat,  col=factor(smi),pch=19,  xlab  =  'First  attribute', 
  ylab  =  'Second  attribute',main  =  'Feature  domain')
plot(pcase$geo,  col=factor(smi),pch=19,  xlab  =  'First  attribute', 
  ylab  =  'Second  attribute',main  =  'Geometry  domain')
par(oldpar)


HCV documentation built on March 18, 2022, 6:01 p.m.

Related to getCluster in HCV...