getRanksWeights: Extract ranks and weights from clValid object

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/clValid-functions.R

Description

Creates matrix of ranks and weights from clValid object, to use as input for rank aggregation using RankAggreg in package RankAggreg

Usage

1
2
getRanksWeights(clVObj, measures = measNames(clVObj), nClust =
                nClusters(clVObj), clAlgs = clusterMethods(clVObj))

Arguments

clVObj

a clValid object

measures

the cluster validation measures to use for rank aggregation

nClust

the number of clusters to evaluate

clAlgs

the clustering algorithms to evaluate

Details

This function extracts cluster validation measures from a clValid object, and creates a matrix of rankings where each row contains a list of clustering algorithms which are ranked according to the validation measure for that row. The function also returns the cluster validation measures as a matrix of weights, for use with weighted rank aggregation in the function RankAggreg. Any combination of validation measures, numbers of clusters, and clustering algorithms can be selected by the user. Number of clusters and clustering algorithms are appended into a single name.

Value

A list with components

ranks

Matrix with rankings for each validation measure in each row

weights

Matrix of weights, corresponding to the cluster validation measures, which are used for weighted rank aggregation

Author(s)

Guy Brock

References

Brock, G., Pihur, V., Datta, S. and Datta, S. (2008) clValid: An R Package for Cluster Validation Journal of Statistical Software 25(4) https://www.jstatsoft.org/v25/i04/

Pihur, V., Datta, S. and Datta, S. (2009) RankAggreg, an R package for weighted rank aggregation BMC Bioinformatics 10:62 https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-10-62/

See Also

clValid, RankAggreg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(mouse)
express <- mouse[1:25,c("M1","M2","M3","NC1","NC2","NC3")]
rownames(express) <- mouse$ID[1:25]
clv <- clValid(express, 4:6, clMethods=c("hierarchical","kmeans","pam"), 
                  validation=c("internal","stability"))
res <- getRanksWeights(clv)
if(require("RankAggreg")) {
  CEWS <- RankAggreg(x=res$ranks, k=5, weights=res$weights, seed=123, verbose=FALSE)
  CEWS
}

Example output

Loading required package: cluster
Loading required package: RankAggreg
The optimal list is: 
        pam-5 pam-4 pam-6 kmeans-6 hierarchical-6

  Algorithm:   CE
  Distance:    Spearman
  Score:       6.618915 

clValid documentation built on Feb. 15, 2021, 1:08 a.m.