Learn R Programming

funcy (version 1.0.1)

accordance: Accordance for cluster outcomes from different methods.

Description

Votes for the cluster with maximum agreement and shows relative number of methods that voted for this cluster.

Usage

accordance(cls, ctrs=NULL, relabel=FALSE)

Arguments

cls

Numeric or character matrix of cluster outcomes for different methods. Cluster outcomes for each method are in columns.

ctrs

If relabel=TRUE, a list of centers for the different methods, if NULL, clusters must have been labeled in an appropriate way before.

relabel

If TRUE, clusters are relabeled according to maximum agreement between their center curves. ctrs must not be NULL in this case.

Value

votedCluster

Cluster with maximum agreement between the methods.

accordance

Percentage of methods that voted for the cluster.

Details

If relabel=FALSE, clusters must have been relabeled in an appropriate way before, so that cluster labels representing the same or the most similar clusters are identical. If relabel=TRUE, centers must be given as list to ctrs. Each list entry consists of a matrix with cluster centers stored in columns.

Examples

Run this code
# NOT RUN {
##Generate dataset
k <- 3
set.seed(2511)
ds <- sampleFuncy(obsNr=30, timeNr=10, reg=TRUE, k=k, sd=.4)
 
##Cluster dataset
res1 <- funcit(methods=1:3, data=Data(ds), k=4, clusters=Cluster(ds))

##Retrieve clusters and centers
cl <- Cluster(res1)
ctr <- Center(res1)

accordance(cl, ctr, relabel=TRUE)
# }

Run the code above in your browser using DataLab