R Under development (unstable) (2024-04-27 r86487 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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(Thresher) Loading required package: ClassDiscovery Loading required package: cluster Loading required package: oompaBase Loading required package: PCDimension > # get saved data > data(savedSims) > reap <- savedReap[[5]] > dset <- reap@data > labels <- factor(paste("C", predict(reap@fit), sep="")) > > # use a different clustering algorithm > hc <- hclust(distanceMatrix(dset, "uncentered"), "average") > newLabels <- paste("New", cutree(hc, k=3), sep="") > tab <- table(OLD=labels, NEW=newLabels) > tab NEW OLD New1 New2 New3 C1 0 0 10 C2 4 0 0 C3 0 6 0 > > # now test the methods > indices <- labelMatcher(tab) > tab[indices$ii, indices$jj] NEW OLD New3 New1 New2 C1 10 0 0 C2 0 4 0 C3 0 0 6 > > matchLabels(tab) NEW OLD New3 New1 New2 C1 10 0 0 C2 0 4 0 C3 0 0 6 > > countAgreement(tab) [1] 20 > > labelAccuracy(dset, labels) pearson spearman euclidean 1.00 1.00 1.00 uncentered correlation absolute pearson sqrt pearson 1.00 0.75 1.00 minkowski maximum weird 1.00 1.00 1.00 > > bestMetric(dset, labels) [1] "pearson" > > proc.time() user system elapsed 0.87 0.09 0.96