Rev 8273 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
R Under development (unstable) (2023-10-19 r85356) -- "Unsuffered Consequences"Copyright (C) 2023 The R Foundation for Statistical ComputingPlatform: x86_64-pc-linux-gnuR 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.> ## not run usually:> if(!cluster:::doExtras()) q("no")>> library(cluster)>> ## generate 1500 objects, divided into 2 clusters.> suppressWarnings(RNGversion("3.5.0")) # << as long as we don't have R >= 3.6.0> set.seed(264) ## <-- different than ./clara.R's !> x <- rbind(cbind(rnorm(700, 0,8), rnorm(700, 0,8)),+ cbind(rnorm(800,50,8), rnorm(800,10,8)))>> isEq <- function(x,y, epsF = 100)+ is.logical(r <- all.equal(x,y, tol = epsF * .Machine$double.eps)) && r>>> .proctime00 <- proc.time()>> ## full size sample {should be = pam()}:> n0 <- length(iSml <- c(1:70, 701:720))> summary(clara0 <- clara(x[iSml,], k = 2, sampsize = n0))Object of class 'clara' from call:clara(x = x[iSml, ], k = 2, sampsize = n0)Medoids:[,1] [,2][1,] 1.406595 0.4453538[2,] 48.585270 13.1867947Objective function: 9.363948Numerical information per cluster:size max_diss av_diss isolation[1,] 70 23.82081 8.941138 0.4874429[2,] 20 25.80404 10.843782 0.5280255Average silhouette width per cluster:[1] 0.7447197 0.6942930Average silhouette width of best sample: 0.7335138Best sample:[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25[26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50[51] 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75[76] 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90Clustering vector:[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2[77] 2 2 2 2 2 2 2 2 2 2 2 2 2 2Silhouette plot information for best sample:cluster neighbor sil_width16 1 2 0.819487065 1 2 0.818684942 1 2 0.817484324 1 2 0.817281763 1 2 0.816244060 1 2 0.815286327 1 2 0.815175015 1 2 0.814498546 1 2 0.813266812 1 2 0.81150397 1 2 0.810741520 1 2 0.810037759 1 2 0.807693840 1 2 0.806177637 1 2 0.805776422 1 2 0.804843518 1 2 0.804518434 1 2 0.80445736 1 2 0.802756053 1 2 0.802014013 1 2 0.801831147 1 2 0.801524443 1 2 0.80135244 1 2 0.800207555 1 2 0.799242519 1 2 0.796640639 1 2 0.796500269 1 2 0.796305926 1 2 0.79348622 1 2 0.793252050 1 2 0.792781141 1 2 0.789653631 1 2 0.785784338 1 2 0.782621730 1 2 0.781383264 1 2 0.775574825 1 2 0.773123411 1 2 0.772415933 1 2 0.767550845 1 2 0.767379136 1 2 0.765493358 1 2 0.761977466 1 2 0.757295529 1 2 0.75669905 1 2 0.748621454 1 2 0.743241962 1 2 0.736614068 1 2 0.729328414 1 2 0.726388623 1 2 0.725583049 1 2 0.719978335 1 2 0.71380183 1 2 0.711797957 1 2 0.696455428 1 2 0.693453548 1 2 0.692813056 1 2 0.670942921 1 2 0.665285932 1 2 0.663915010 1 2 0.663648517 1 2 0.662638052 1 2 0.660889651 1 2 0.660398267 1 2 0.640593244 1 2 0.630587361 1 2 0.61145189 1 2 0.58754608 1 2 0.54921861 1 2 0.522946770 1 2 0.274235285 2 1 0.784469672 2 1 0.778162678 2 1 0.771967179 2 1 0.770205687 2 1 0.768261974 2 1 0.766427471 2 1 0.760712183 2 1 0.756778981 2 1 0.735228582 2 1 0.721393490 2 1 0.717608180 2 1 0.673105977 2 1 0.673088384 2 1 0.665768988 2 1 0.654864786 2 1 0.645476476 2 1 0.602832175 2 1 0.601464673 2 1 0.576459089 2 1 0.46158484005 dissimilarities, summarized :Min. 1st Qu. Median Mean 3rd Qu. Max.0.3757 10.1410 18.1790 26.5090 45.6080 82.6710Metric : euclideanNumber of objects : 90Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> pam0 <- pam (x[iSml,], k = 2)> stopifnot(identical(clara0$clustering, pam0$clustering)+ , isEq(clara0$objective, unname(pam0$objective[2]))+ )>> summary(clara2 <- clara(x, 2))Object of class 'clara' from call:clara(x = x, k = 2)Medoids:[,1] [,2][1,] 0.04089097 0.02320045[2,] 51.20275990 11.75050315Objective function: 9.627208Numerical information per cluster:size max_diss av_diss isolation[1,] 701 28.92506 9.585969 0.5510719[2,] 799 28.92254 9.663390 0.5510239Average silhouette width per cluster:[1] 0.7404738 0.7679151Average silhouette width of best sample: 0.7548181Best sample:[1] 17 46 61 152 201 223 254 263 268 291 313 331 479 508 528[16] 542 543 601 647 655 681 746 778 792 888 951 957 1010 1081 1085[31] 1105 1110 1122 1136 1231 1265 1272 1307 1342 1365 1383 1393 1395 1467Clustering vector:[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[149] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[186] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[223] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[260] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[297] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[334] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[371] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[408] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[445] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[482] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[519] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[556] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[593] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[630] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1[667] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2[704] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[741] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[778] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[815] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[852] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[889] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[926] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[963] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1000] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1037] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1074] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1111] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1148] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1185] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1222] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1259] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1296] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1333] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1370] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1407] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1444] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2[1481] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2Silhouette plot information for best sample:cluster neighbor sil_width647 1 2 0.8168036223 1 2 0.8117572263 1 2 0.8072019152 1 2 0.8037261201 1 2 0.795633446 1 2 0.7928588508 1 2 0.7857050528 1 2 0.7773186291 1 2 0.7731206254 1 2 0.7704038655 1 2 0.7586029268 1 2 0.7448140331 1 2 0.7368253479 1 2 0.7195332542 1 2 0.6963969313 1 2 0.694602617 1 2 0.6803030681 1 2 0.6798070601 1 2 0.670332661 1 2 0.6567378543 1 2 0.5774663746 2 1 0.84306931136 2 1 0.84257781383 2 1 0.83866111395 2 1 0.83660961467 2 1 0.8302860792 2 1 0.8277142778 2 1 0.82577321110 2 1 0.82173661122 2 1 0.81453131272 2 1 0.8098449888 2 1 0.80638531265 2 1 0.7957217951 2 1 0.79405721010 2 1 0.77942751085 2 1 0.7684807957 2 1 0.76492811081 2 1 0.73708301307 2 1 0.73664531393 2 1 0.72562751231 2 1 0.70290401342 2 1 0.67621511365 2 1 0.60044531105 2 1 0.4833222946 dissimilarities, summarized :Min. 1st Qu. Median Mean 3rd Qu. Max.0.8754 11.8110 32.7990 31.9700 51.4100 79.8060Metric : euclideanNumber of objects : 44Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data">> clInd <- c("objective", "i.med", "medoids", "clusinfo")> clInS <- c(clInd, "sample")> ## clara() {as original code} always draws the *same* random samples !!!!> clara(x, 2, samples = 50)[clInd]$objective[1] 9.600858$i.med[1] 610 1076$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 50.0601381 9.6999505$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5733721[2,] 799 27.83521 9.619546 0.5439049>> ## The for() code below *did* hang (in some 64-bit versions of R / clara / ...):> ## but this has been fixed *long* ago> xx <- x[sample(nrow(x)),]> if(FALSE) { ## only run manually+ ff <- "/u/maechler/R/MM/Pkg-ex/cluster/clara2-ex.rds"+ if(file.exists(ff))+ xx <- readRDS(ff)+ else+ saveRDS(xx, file=ff)+ }> print(clara(xx, 2, samples= 5, trace = 3)[clInd])C clara(): (nsam,nran,n) = (44,5,1500);- clara sample 1 finding 1st... new k{ran}:.. kall: FALSE,... nrx [0:1]= 0 0... nsel[0:0]= 23[ntt=44, nunfs=0] .. nsel[1:44]= 23 54 87 103 140 199 246 303 306 322 394 408 412 414 428 461 468 521 592 647 859 898 906 967 971 1007 1028 1039 1114 1149 1151 1192 1237 1250 1279 1291 1301 1317 1340 1353 1366 1381 1383 1492 -> dysta2();clara -> s:= max{dys[1..946]} = 84.6494;bswap2(*, s=84.6494), 1. BUILD: new repr. 13new repr. 6after build: medoids are 6 13and min.dist dysma[1:n] are10 14 7.21 10.5 17.8 0 6.26 3.23 16.7 20.39.36 18.6 0 7.47 4.31 11 18 15.7 23 5.516.99 8.5 15.8 6.82 9.51 19.2 14.9 18 15.5 12.127.6 10 15.7 15.2 20.5 9.7 11.4 9.74 4.5 20.812.7 21.9 8.81 6.32--> sky = sum_j D_j= 541.2swp new 11 <-> 13 old; decreasing diss. by -104.377Last swap: new 11 <-> 13 old; decreasing diss. by 1end{bswap2}: sky = 436.8241st proper sample obj= 10.1407- clara sample 2 if (kall && nunfs...):.. kall: T,... nrx [0:1]= 199 394... nsel[0:1]= 199 394[ntt=44, nunfs=0] .. nsel[1:44]= 21 50 97 142 168 191 192 197 199 224 325 328 394 433 458 471 651 712 714 722 797 805 837 909 919 926 999 1006 1018 1019 1049 1081 1084 1132 1144 1150 1201 1207 1291 1307 1330 1374 1426 1428 -> dysta2();clara -> s:= max{dys[1..946]} = 82.2326;bswap2(*, s=82.2326), 1. BUILD: new repr. 24new repr. 27after build: medoids are 24 27and min.dist dysma[1:n] are9.51 9 12.4 9.47 8.34 17.9 13.1 12 12.3 11.19.17 5.89 4.52 5.11 19.9 5.59 11.4 20 7.41 7.669.16 12.3 5.93 0 15.1 24.6 0 7.13 14 10.57.44 18.2 5.66 11.9 32.8 26.6 21.4 11.1 12.5 9.4611.2 28.9 4.6 14.4--> sky = sum_j D_j= 526.744swp new 30 <-> 24 old; decreasing diss. by -110.942Last swap: new 30 <-> 24 old; decreasing diss. by 1end{bswap2}: sky = 415.802new best obj= 9.77929- clara sample 3 if (kall && nunfs...):.. kall: T,... nrx [0:1]= 1019 999... nsel[0:1]= 999 1019[ntt=44, nunfs=0] .. nsel[1:44]= 10 15 23 46 85 90 94 105 112 225 278 313 485 486 502 513 529 639 641 660 681 757 796 812 814 865 876 896 954 959 973 999 1019 1032 1045 1249 1264 1269 1273 1296 1297 1336 1361 1399 -> dysta2();clara -> s:= max{dys[1..946]} = 82.2209;bswap2(*, s=82.2209), 1. BUILD: new repr. 9new repr. 33after build: medoids are 9 33and min.dist dysma[1:n] are14.1 5.99 12.1 9.56 9.14 7.24 24.5 10.6 0 10.117.2 14.5 16.4 16.9 9.15 12.6 15.6 5.89 17.3 11.813 8.93 12.9 17.4 13.5 14.3 5.59 1.76 3.86 1.5119.7 15.1 0 11.4 21.8 5.73 15.1 2.16 18.3 19.610.3 13.3 19.4 28.3--> sky = sum_j D_j= 533.592swp new 16 <-> 9 old; decreasing diss. by -161.129Last swap: new 28 <-> 33 old; decreasing diss. by 0.438978end{bswap2}: sky = 372.463obj= 9.78523- clara sample 4 if (kall && nunfs...):.. kall: T,... nrx [0:1]= 1019 999... nsel[0:1]= 999 1019[ntt=44, nunfs=0] .. nsel[1:44]= 17 46 61 152 201 223 254 263 268 291 313 331 479 508 528 542 543 601 655 681 746 778 792 888 951 957 999 1010 1019 1081 1085 1105 1110 1122 1136 1231 1265 1272 1307 1342 1365 1393 1395 1467 -> dysta2();clara -> s:= max{dys[1..946]} = 77.6857;bswap2(*, s=77.6857), 1. BUILD: new repr. 24new repr. 28after build: medoids are 24 28and min.dist dysma[1:n] are13.7 8.04 8.56 2.4 16.4 2.6 5.22 12.2 8.64 16.84.3 16 5.07 7.99 9.29 3.52 6.16 13.9 13.4 13.69.1 7.24 11.4 0 11.8 6.74 2.68 0 2.54 11.213.4 12 13.7 7.04 9.78 10.4 17.3 7.93 1.68 6.5710.2 11.7 19.9 11.5--> sky = sum_j D_j= 403.513swp new 14 <-> 24 old; decreasing diss. by -35.3245Last swap: new 38 <-> 14 old; decreasing diss. by 0.398398end{bswap2}: sky = 368.188obj= 9.95647- clara sample 5 if (kall && nunfs...):.. kall: T,... nrx [0:1]= 1019 999... nsel[0:1]= 999 1019[ntt=44, nunfs=0] .. nsel[1:44]= 7 38 134 140 282 283 311 329 363 461 496 539 572 585 631 655 665 695 758 792 820 823 912 919 962 999 1019 1121 1140 1166 1189 1192 1202 1204 1260 1297 1315 1321 1326 1422 1431 1432 1463 1488 -> dysta2();clara -> s:= max{dys[1..946]} = 73.7802;bswap2(*, s=73.7802), 1. BUILD: new repr. 40new repr. 26after build: medoids are 26 40and min.dist dysma[1:n] are5.14 20.6 14.8 10.9 12.3 8.62 10 20.1 12.4 22.66.52 18.8 4.41 11.3 5.33 10.7 12.2 8.8 10.6 12.621.5 10.5 16.4 14.3 6.8 0 9.53 12.6 14.7 8.847.12 13 19.9 12.9 15.6 12.2 10.7 15.3 20.3 016 15.2 10.7 25.7--> sky = sum_j D_j= 548.29swp new 17 <-> 40 old; decreasing diss. by -133.064Last swap: new 17 <-> 40 old; decreasing diss. by 1end{bswap2}: sky = 415.226new best obj= 9.66316C clara() -> best sample _found_ ; nbest[1:44] =c(7,38,134,140,282,283,311,329,363,461,496,539,572,585,631,655,665,695,758,792,820,823,912,919,962,999,1019,1121,1140,1166,1189,1192,1202,1204,1260,1297,1315,1321,1326,1422,1431,1432,1463,1488)resul(), black() and return() from C.$objective[1] 9.663163$i.med[1] 665 999$medoids[,1] [,2][1,] -0.7570035 -0.8940899[2,] 51.5040456 9.4101489$clusinfosize max_diss av_diss isolation[1,] 701 30.13143 9.602938 0.5656658[2,] 799 28.92185 9.716001 0.5429579>> print(clara(xx, 2, samples=50, trace = 2)[clInd])C clara(): (nsam,nran,n) = (44,50,1500);- clara sample 1 finding 1st... new k{ran}:.. kall: FALSE, nsel[ntt=1] = 0[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 84.6494;bswap2(), 1. BUILD: 13 6 after build: medoids are 6 13--> sky = sum_j D_j= 541.2Last swap: new 11 <-> 13 old; decreasing diss. by 1end{bswap2}: sky = 436.8241st proper sample obj= 10.1407- clara sample 2 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 87[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.2326;bswap2(), 1. BUILD: 24 27 after build: medoids are 24 27--> sky = sum_j D_j= 526.744Last swap: new 30 <-> 24 old; decreasing diss. by 1end{bswap2}: sky = 415.802new best obj= 9.77929- clara sample 3 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 97[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.2209;bswap2(), 1. BUILD: 9 33 after build: medoids are 9 33--> sky = sum_j D_j= 533.592Last swap: new 28 <-> 33 old; decreasing diss. by 0.438978end{bswap2}: sky = 372.463obj= 9.78523- clara sample 4 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 23[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 77.6857;bswap2(), 1. BUILD: 24 28 after build: medoids are 24 28--> sky = sum_j D_j= 403.513Last swap: new 38 <-> 14 old; decreasing diss. by 0.398398end{bswap2}: sky = 368.188obj= 9.95647- clara sample 5 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 61[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 73.7802;bswap2(), 1. BUILD: 40 26 after build: medoids are 26 40--> sky = sum_j D_j= 548.29Last swap: new 17 <-> 40 old; decreasing diss. by 1end{bswap2}: sky = 415.226new best obj= 9.66316- clara sample 6 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 134[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 76.4132;bswap2(), 1. BUILD: 24 40 after build: medoids are 24 40--> sky = sum_j D_j= 493.892Last swap: new 16 <-> 24 old; decreasing diss. by 1end{bswap2}: sky = 382.8obj= 10.2053- clara sample 7 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 179[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 91.2407;bswap2(), 1. BUILD: 18 39 after build: medoids are 18 39--> sky = sum_j D_j= 559.095Last swap: new 41 <-> 20 old; decreasing diss. by 0.410198end{bswap2}: sky = 413.093obj= 9.68805- clara sample 8 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 45[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 78.2768;bswap2(), 1. BUILD: 37 24 after build: medoids are 24 37--> sky = sum_j D_j= 526.826Last swap: new 14 <-> 29 old; decreasing diss. by 0.887381end{bswap2}: sky = 431.746obj= 9.66316- clara sample 9 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 59[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 85.1138;bswap2(), 1. BUILD: 42 24 after build: medoids are 24 42--> sky = sum_j D_j= 524.654Last swap: new 11 <-> 42 old; decreasing diss. by 1end{bswap2}: sky = 397.695obj= 10.3746- clara sample 10 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 119[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 91.3475;bswap2(), 1. BUILD: 23 17 after build: medoids are 17 23--> sky = sum_j D_j= 606.383Last swap: new 21 <-> 17 old; decreasing diss. by 0.597088end{bswap2}: sky = 452.021obj= 9.75314- clara sample 11 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 93[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 88.9424;bswap2(), 1. BUILD: 5 37 after build: medoids are 5 37--> sky = sum_j D_j= 510.544Last swap: new 30 <-> 5 old; decreasing diss. by 1end{bswap2}: sky = 419.179new best obj= 9.65359- clara sample 12 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 44[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 80.4915;bswap2(), 1. BUILD: 23 25 after build: medoids are 23 25--> sky = sum_j D_j= 423.319Last swap: new 1 <-> 23 old; decreasing diss. by 1end{bswap2}: sky = 369.493obj= 9.78288- clara sample 13 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 92[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 76.1143;bswap2(), 1. BUILD: 22 30 after build: medoids are 22 30--> sky = sum_j D_j= 538.28Last swap: new 14 <-> 22 old; decreasing diss. by 1end{bswap2}: sky = 419.593obj= 9.80239- clara sample 14 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 108[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 79.6275;bswap2(), 1. BUILD: 31 35 after build: medoids are 31 35--> sky = sum_j D_j= 501.393Last swap: new 34 <-> 30 old; decreasing diss. by 0.371241end{bswap2}: sky = 404.715obj= 9.99603- clara sample 15 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 41[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 85.1226;bswap2(), 1. BUILD: 42 25 after build: medoids are 25 42--> sky = sum_j D_j= 479.866Last swap: new 10 <-> 42 old; decreasing diss. by 1end{bswap2}: sky = 397.846obj= 9.91509- clara sample 16 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 221[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.6708;bswap2(), 1. BUILD: 7 32 after build: medoids are 7 32--> sky = sum_j D_j= 430.691Last swap: new 40 <-> 19 old; decreasing diss. by 0.967002end{bswap2}: sky = 385.483obj= 9.75954- clara sample 17 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 63[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 75.4038;bswap2(), 1. BUILD: 23 35 after build: medoids are 23 35--> sky = sum_j D_j= 405.816Last swap: new 4 <-> 23 old; decreasing diss. by 1end{bswap2}: sky = 332.314new best obj= 9.65233- clara sample 18 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 123[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 79.3412;bswap2(), 1. BUILD: 19 4 after build: medoids are 4 19--> sky = sum_j D_j= 523.479Last swap: new 17 <-> 19 old; decreasing diss. by 1end{bswap2}: sky = 391.149obj= 9.76199- clara sample 19 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 135[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 81.6923;bswap2(), 1. BUILD: 5 4 after build: medoids are 4 5--> sky = sum_j D_j= 429.005Last swap: new 37 <-> 5 old; decreasing diss. by 1end{bswap2}: sky = 391.347obj= 9.65233- clara sample 20 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 84[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 74.6473;bswap2(), 1. BUILD: 13 36 after build: medoids are 13 36--> sky = sum_j D_j= 397.89Last swap: new 16 <-> 36 old; decreasing diss. by 0.311398end{bswap2}: sky = 354.641new best obj= 9.63025- clara sample 21 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 128[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.2868;bswap2(), 1. BUILD: 35 34 after build: medoids are 34 35--> sky = sum_j D_j= 508.413Last swap: new 31 <-> 35 old; decreasing diss. by 1end{bswap2}: sky = 362.906obj= 9.65359- clara sample 22 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 105[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 75.1174;bswap2(), 1. BUILD: 41 29 after build: medoids are 29 41--> sky = sum_j D_j= 493.584Last swap: new 23 <-> 41 old; decreasing diss. by 1end{bswap2}: sky = 353.321obj= 9.63025- clara sample 23 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 204[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 73.7656;bswap2(), 1. BUILD: 13 11 after build: medoids are 11 13--> sky = sum_j D_j= 705.978Last swap: new 26 <-> 13 old; decreasing diss. by 1end{bswap2}: sky = 441.528obj= 9.64875- clara sample 24 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 87[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 87.1927;bswap2(), 1. BUILD: 13 7 after build: medoids are 7 13--> sky = sum_j D_j= 509.62Last swap: new 4 <-> 7 old; decreasing diss. by 0.692058end{bswap2}: sky = 417.527obj= 9.95795- clara sample 25 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 140[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 72.5392;bswap2(), 1. BUILD: 7 31 after build: medoids are 7 31--> sky = sum_j D_j= 420.983Last swap: new 27 <-> 7 old; decreasing diss. by 1end{bswap2}: sky = 405.433obj= 9.63025- clara sample 26 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 273[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 83.0823;bswap2(), 1. BUILD: 34 39 after build: medoids are 34 39--> sky = sum_j D_j= 633.387Last swap: new 6 <-> 34 old; decreasing diss. by 1end{bswap2}: sky = 471.03new best obj= 9.61429- clara sample 27 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 128[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 79.4914;bswap2(), 1. BUILD: 43 37 after build: medoids are 37 43--> sky = sum_j D_j= 524.694Last swap: new 6 <-> 43 old; decreasing diss. by 1end{bswap2}: sky = 426.746obj= 9.61429- clara sample 28 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 74[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 99.9366;bswap2(), 1. BUILD: 40 11 after build: medoids are 11 40--> sky = sum_j D_j= 515.562Last swap: new 38 <-> 34 old; decreasing diss. by 0.898884end{bswap2}: sky = 403.623obj= 9.70784- clara sample 29 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 95[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 89.4153;bswap2(), 1. BUILD: 2 35 after build: medoids are 2 35--> sky = sum_j D_j= 518.835Last swap: new 7 <-> 6 old; decreasing diss. by 0.00389548end{bswap2}: sky = 423obj= 9.61429- clara sample 30 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 160[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 75.5398;bswap2(), 1. BUILD: 17 11 after build: medoids are 11 17--> sky = sum_j D_j= 464.06Last swap: new 13 <-> 11 old; decreasing diss. by 0.230267end{bswap2}: sky = 398.565obj= 9.61429- clara sample 31 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 45[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 78.2302;bswap2(), 1. BUILD: 40 19 after build: medoids are 19 40--> sky = sum_j D_j= 580.438Last swap: new 13 <-> 40 old; decreasing diss. by 1end{bswap2}: sky = 367.223obj= 9.91942- clara sample 32 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 56[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 84.5005;bswap2(), 1. BUILD: 12 32 after build: medoids are 12 32--> sky = sum_j D_j= 444.913Last swap: new 27 <-> 7 old; decreasing diss. by 0.228504end{bswap2}: sky = 363.142obj= 9.77547- clara sample 33 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 50[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 76.488;bswap2(), 1. BUILD: 25 26 after build: medoids are 25 26--> sky = sum_j D_j= 419.591Last swap: new 38 <-> 5 old; decreasing diss. by 0.631655end{bswap2}: sky = 357.699obj= 9.61429- clara sample 34 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 165[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 78.0499;bswap2(), 1. BUILD: 40 37 after build: medoids are 37 40--> sky = sum_j D_j= 424.572Last swap: new 9 <-> 10 old; decreasing diss. by 0.233331end{bswap2}: sky = 354.223obj= 10.2203- clara sample 35 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 123[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 79.8045;bswap2(), 1. BUILD: 5 42 after build: medoids are 5 42--> sky = sum_j D_j= 515.209Last swap: new 41 <-> 42 old; decreasing diss. by 0.913161end{bswap2}: sky = 397.716obj= 9.6157- clara sample 36 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 58[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 83.3107;bswap2(), 1. BUILD: 10 34 after build: medoids are 10 34--> sky = sum_j D_j= 503.551Last swap: new 16 <-> 7 old; decreasing diss. by 0.893467end{bswap2}: sky = 402.752obj= 9.61429- clara sample 37 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 94[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.2963;bswap2(), 1. BUILD: 1 31 after build: medoids are 1 31--> sky = sum_j D_j= 712.371Last swap: new 7 <-> 1 old; decreasing diss. by 1end{bswap2}: sky = 447.183obj= 9.61429- clara sample 38 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 117[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 95.8048;bswap2(), 1. BUILD: 26 1 after build: medoids are 1 26--> sky = sum_j D_j= 516.385Last swap: new 15 <-> 1 old; decreasing diss. by 0.188094end{bswap2}: sky = 425.344obj= 9.86458- clara sample 39 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 63[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 86.6027;bswap2(), 1. BUILD: 37 6 after build: medoids are 6 37--> sky = sum_j D_j= 481.819Last swap: new 23 <-> 6 old; decreasing diss. by 0.242997end{bswap2}: sky = 417.783obj= 9.96942- clara sample 40 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 96[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 86.7782;bswap2(), 1. BUILD: 27 21 after build: medoids are 21 27--> sky = sum_j D_j= 724.939Last swap: new 10 <-> 27 old; decreasing diss. by 1end{bswap2}: sky = 428.52obj= 10.8484- clara sample 41 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 125[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 82.3384;bswap2(), 1. BUILD: 2 29 after build: medoids are 2 29--> sky = sum_j D_j= 714.103Last swap: new 6 <-> 2 old; decreasing diss. by 1end{bswap2}: sky = 411.244obj= 10.3511- clara sample 42 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 23[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 74.2665;bswap2(), 1. BUILD: 3 30 after build: medoids are 3 30--> sky = sum_j D_j= 541.34Last swap: new 21 <-> 30 old; decreasing diss. by 0.0870194end{bswap2}: sky = 413.299obj= 10.5262- clara sample 43 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 112[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 70.5586;bswap2(), 1. BUILD: 41 31 after build: medoids are 31 41--> sky = sum_j D_j= 383.305Last swap: new 14 <-> 41 old; decreasing diss. by 1end{bswap2}: sky = 323.571obj= 10.2205- clara sample 44 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 100[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 81.0334;bswap2(), 1. BUILD: 28 13 after build: medoids are 13 28--> sky = sum_j D_j= 695.34Last swap: new 8 <-> 13 old; decreasing diss. by 0.260756end{bswap2}: sky = 393.903obj= 11.2797- clara sample 45 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 186[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 80.4615;bswap2(), 1. BUILD: 2 39 after build: medoids are 2 39--> sky = sum_j D_j= 488.193Last swap: new 9 <-> 39 old; decreasing diss. by 0.396945end{bswap2}: sky = 422.85obj= 9.97243- clara sample 46 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 72[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 90.7292;bswap2(), 1. BUILD: 22 37 after build: medoids are 22 37--> sky = sum_j D_j= 559.363Last swap: new 34 <-> 22 old; decreasing diss. by 1end{bswap2}: sky = 423.583obj= 9.75509- clara sample 47 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 141[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 81.6717;bswap2(), 1. BUILD: 41 2 after build: medoids are 2 41--> sky = sum_j D_j= 463.14Last swap: new 34 <-> 2 old; decreasing diss. by 0.879526end{bswap2}: sky = 391.527obj= 9.86629- clara sample 48 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 67[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 75.0878;bswap2(), 1. BUILD: 42 31 after build: medoids are 31 42--> sky = sum_j D_j= 570.247Last swap: new 37 <-> 31 old; decreasing diss. by 0.844474end{bswap2}: sky = 408.073obj= 9.92563- clara sample 49 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 121[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 87.5173;bswap2(), 1. BUILD: 13 34 after build: medoids are 13 34--> sky = sum_j D_j= 504.821Last swap: new 35 <-> 13 old; decreasing diss. by 1end{bswap2}: sky = 408.675obj= 9.76274- clara sample 50 if (kall && nunfs...):.. kall: T, nsel[ntt=2] = 78[ntt=44, nunfs=0] -> dysta2();clara -> s:= max{dys[1..946]} = 87.7511;bswap2(), 1. BUILD: 23 30 after build: medoids are 23 30--> sky = sum_j D_j= 502.458Last swap: new 12 <-> 23 old; decreasing diss. by 1end{bswap2}: sky = 400.127obj= 9.64357C clara() -> best sample _found_ ; nbest[1:44] =c(65,126,128,136,211,219,340,413,420,421,432,433,463,498,528,546,558,565,606,615,621,705,715,722,744,754,788,840,842,935,964,1001,1010,1011,1082,1105,1106,1138,1147,1239,1242,1326,1347,1385)resul(), black() and return() from C.$objective[1] 9.61429$i.med[1] 1147 219$medoids[,1] [,2][1,] 0.04086397 -0.4319988[2,] 51.31958457 11.3088406$clusinfosize max_diss av_diss isolation[1,] 701 29.22993 9.582446 0.5556424[2,] 799 28.46765 9.642228 0.5411520> ## ^^^^^^^^^ a bit less output ...> ## for sample 45> ## From that output I gather the sample indices nsel[] and all k{ran} are> ii <- c(194, 1411,+ 1430,398,570,72,27,62,1301,368,1390,991,296,431,1019,186,558,258,413,+ 647,585,1352,1073,873,377,711,1498,865,1436,1335,189,622,760,226,146,+ 145,1349,382,1368,934,204,303,856,1489)> ## Trying> pp <- pam(x[ii,], k =2) # gives no problem>> for(i in 1:19)+ print(clara(x[sample(nrow(x)),], 2, samples = 50)[clInd])$objective[1] 9.611541$i.med[1] 521 20$medoids[,1] [,2][1,] 50.345402 10.336172[2,] -1.017259 -1.286059$clusinfosize max_diss av_diss isolation[1,] 800 30.06899 9.612016 0.5709897[2,] 700 29.57957 9.610998 0.5616961$objective[1] 9.586637$i.med[1] 448 1406$medoids[,1] [,2][1,] 0.04089097 0.02320045[2,] 49.86457170 10.52278658$clusinfosize max_diss av_diss isolation[1,] 701 28.92506 9.585969 0.5680717[2,] 799 28.27901 9.587224 0.5553837$objective[1] 9.585964$i.med[1] 451 740$medoids[,1] [,2][1,] -0.5009691 -0.6486965[2,] 50.3454017 10.3361719$clusinfosize max_diss av_diss isolation[1,] 701 29.77696 9.585453 0.5724200[2,] 799 27.91861 9.586413 0.5366958$objective[1] 9.583641$i.med[1] 539 387$medoids[,1] [,2][1,] 49.8645717 10.5227866[2,] -0.1009724 -0.4444724$clusinfosize max_diss av_diss isolation[1,] 799 28.27901 9.587224 0.5528101[2,] 701 29.34325 9.579557 0.5736142$objective[1] 9.58722$i.med[1] 58 207$medoids[,1] [,2][1,] 0.04086397 -0.4319988[2,] 50.53763943 11.1072301$clusinfosize max_diss av_diss isolation[1,] 701 29.22993 9.582446 0.5643014[2,] 799 28.55938 9.591408 0.5513560$objective[1] 9.583641$i.med[1] 676 337$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 49.8645717 10.5227866$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5736142[2,] 799 28.27901 9.587224 0.5528101$objective[1] 9.61429$i.med[1] 152 1319$medoids[,1] [,2][1,] 51.31958457 11.3088406[2,] 0.04086397 -0.4319988$clusinfosize max_diss av_diss isolation[1,] 799 28.46765 9.642228 0.5411520[2,] 701 29.22993 9.582446 0.5556424$objective[1] 9.605953$i.med[1] 1033 864$medoids[,1] [,2][1,] -0.5554117 0.3590557[2,] 50.4054368 11.4682101$clusinfosize max_diss av_diss isolation[1,] 701 29.15394 9.604919 0.5589579[2,] 799 28.94365 9.606860 0.5549261$objective[1] 9.583485$i.med[1] 631 665$medoids[,1] [,2][1,] 50.3454017 10.3361719[2,] -0.4618501 -0.3644744$clusinfosize max_diss av_diss isolation[1,] 799 27.91861 9.586413 0.5377042[2,] 701 29.55835 9.580148 0.5692851$objective[1] 9.583641$i.med[1] 1231 925$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 49.8645717 10.5227866$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5736142[2,] 799 28.27901 9.587224 0.5528101$objective[1] 9.584559$i.med[1] 979 1481$medoids[,1] [,2][1,] 0.04086397 -0.4319988[2,] 50.34540167 10.3361719$clusinfosize max_diss av_diss isolation[1,] 701 29.22993 9.582446 0.5681877[2,] 799 27.91861 9.586413 0.5426975$objective[1] 9.583641$i.med[1] 1182 1333$medoids[,1] [,2][1,] 49.8645717 10.5227866[2,] -0.1009724 -0.4444724$clusinfosize max_diss av_diss isolation[1,] 799 28.27901 9.587224 0.5528101[2,] 701 29.34325 9.579557 0.5736142$objective[1] 9.589808$i.med[1] 1406 1112$medoids[,1] [,2][1,] 50.34540167 10.3361719[2,] 0.03259824 0.2228907$clusinfosize max_diss av_diss isolation[1,] 799 27.91861 9.586413 0.5440191[2,] 701 28.79880 9.593678 0.5611705$objective[1] 9.583915$i.med[1] 608 146$medoids[,1] [,2][1,] -0.4618501 -0.3644744[2,] 49.8645717 10.5227866$clusinfosize max_diss av_diss isolation[1,] 700 28.55288 9.551608 0.5545261[2,] 800 29.55445 9.612183 0.5739776$objective[1] 9.583641$i.med[1] 1042 201$medoids[,1] [,2][1,] 49.8645717 10.5227866[2,] -0.1009724 -0.4444724$clusinfosize max_diss av_diss isolation[1,] 799 28.27901 9.587224 0.5528101[2,] 701 29.34325 9.579557 0.5736142$objective[1] 9.603614$i.med[1] 1016 1459$medoids[,1] [,2][1,] 50.0601381 9.6999505[2,] -0.5009691 -0.6486965$clusinfosize max_diss av_diss isolation[1,] 799 27.83521 9.619546 0.5393449[2,] 701 29.77696 9.585453 0.5769689$objective[1] 9.603018$i.med[1] 747 329$medoids[,1] [,2][1,] -0.7570035 -0.8940899[2,] 49.8526971 11.3178899$clusinfosize max_diss av_diss isolation[1,] 700 29.13678 9.573612 0.5596531[2,] 800 29.31755 9.628749 0.5631253$objective[1] 9.612711$i.med[1] 975 593$medoids[,1] [,2][1,] -0.5554117 0.3590557[2,] 50.0601381 9.6999505$clusinfosize max_diss av_diss isolation[1,] 701 29.15394 9.604919 0.5664231[2,] 799 27.83521 9.619546 0.5408020$objective[1] 9.583915$i.med[1] 457 1078$medoids[,1] [,2][1,] -0.4618501 -0.3644744[2,] 49.8645717 10.5227866$clusinfosize max_diss av_diss isolation[1,] 700 28.55288 9.551608 0.5545261[2,] 800 29.55445 9.612183 0.5739776>> clara(x, 2, samples = 101)[clInd]$objective[1] 9.583209$i.med[1] 610 1348$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 50.3454017 10.3361719$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5688279[2,] 799 27.91861 9.586413 0.5412108> clara(x, 2, samples = 149)[clInd]$objective[1] 9.583209$i.med[1] 610 1348$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 50.3454017 10.3361719$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5688279[2,] 799 27.91861 9.586413 0.5412108> clara(x, 2, samples = 200)[clInd]$objective[1] 9.583209$i.med[1] 610 1348$medoids[,1] [,2][1,] -0.1009724 -0.4444724[2,] 50.3454017 10.3361719$clusinfosize max_diss av_diss isolation[1,] 701 29.34325 9.579557 0.5688279[2,] 799 27.91861 9.586413 0.5412108> ## Note that this last one is practically identical to the slower pam() one>> x[print(sample(length(x), 20))] <- NA[1] 2602 1026 1287 708 21 1768 759 2213 1255 2094 1919 2268 2055 2667 872[16] 357 1444 2831 537 1763> clara(x, 2, samples = 50)[clInd]$objective[1] 8.3444$i.med[1] 21 876$medoids[,1] [,2][1,] NA 4.090334[2,] 50.61538 14.930754$clusinfosize max_diss av_diss isolation[1,] 1029 35.44244 8.571381 2.311865[2,] 471 87.53589 7.760733 5.709855Warning message:In clara(x, 2, samples = 50) :Distance computations with NAs: using correct instead of pre-2016 wrong formula.Use 'correct.d=FALSE' to get previous results or set 'correct.d=TRUE' explicitlyto suppress this warning.>> ###--- Start a version of example(clara) ------->> ## xclara : artificial data with 3 clusters of 1000 bivariate objects each.> data(xclara)> (clx3 <- clara(xclara, 3))Call: clara(x = xclara, k = 3)Medoids:V1 V2[1,] 5.553391 13.306260[2,] 43.198760 60.360720[3,] 74.591890 -6.969018Objective function: 13.225Clustering vector: int [1:3000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 900 1148 952Best sample:[1] 20 30 46 91 92 169 179 187 209 223 382 450 555 971 1004[16] 1025 1058 1277 1281 1302 1319 1361 1362 1513 1591 1623 1628 1729 1752 1791[31] 1907 1917 1946 2064 2089 2498 2527 2537 2545 2591 2672 2722 2729 2790 2797[46] 2852Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> ## Plot similar to Figure 5 in Struyf et al (1996)> plot(clx3)>> ## The rngR = TRUE case is currently in the non-strict tests> ## ./clara-ex.R> ## ~~~~~~~~~~~~>> ## trace output checking> RNGversion("4.3"); RNGkind()[1] "Mersenne-Twister" "Inversion" "Rejection"> set.seed(144)> xc120 <- xclara[sort(sample.int(nrow(xclara), 120)), ]> cx3.1 <- clara(xc120, 3, trace = 1)C clara(): (nsam,nran,n) = (46,5,120);- clara sample 1 [ntt=46, nunfs=0] -> dysta2(); obj= 13.4142- clara sample 2 [ntt=46, nunfs=0] -> dysta2(); obj= 13.349- clara sample 3 [ntt=46, nunfs=0] -> dysta2(); obj= 12.8491- clara sample 4 [ntt=46, nunfs=0] -> dysta2(); obj= 12.6975- clara sample 5 [ntt=46, nunfs=0] -> dysta2(); obj= 13.7493C clara() -> best sample _found_ resul(), black() and return() from C.> cx3.2 <- clara(xc120, 3, trace = 2)C clara(): (nsam,nran,n) = (46,5,120);- clara sample 1 finding 1st... new k{ran}:.. kall: FALSE, nsel[ntt=1] = 0[ntt=46, nunfs=0] -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(), 1. BUILD: 7 20 44 after build: medoids are 7 20 44--> sky = sum_j D_j= 711.359Last swap: new 3 <-> 7 old; decreasing diss. by 1end{bswap2}: sky = 570.7251st proper sample obj= 13.4142- clara sample 2 if (kall && nunfs...):.. kall: T, nsel[ntt=3] = 9[ntt=46, nunfs=0] -> dysta2();clara -> s:= max{dys[1..1035]} = 114.718;bswap2(), 1. BUILD: 17 44 9 after build: medoids are 9 17 44--> sky = sum_j D_j= 786.108Last swap: new 33 <-> 17 old; decreasing diss. by 1end{bswap2}: sky = 617.268new best obj= 13.349- clara sample 3 if (kall && nunfs...):.. kall: T, nsel[ntt=3] = 8[ntt=46, nunfs=0] -> dysta2();clara -> s:= max{dys[1..1035]} = 109.395;bswap2(), 1. BUILD: 27 11 44 after build: medoids are 11 27 44--> sky = sum_j D_j= 774.014Last swap: new 5 <-> 11 old; decreasing diss. by 1end{bswap2}: sky = 532.229new best obj= 12.8491- clara sample 4 if (kall && nunfs...):.. kall: T, nsel[ntt=3] = 5[ntt=46, nunfs=0] -> dysta2();clara -> s:= max{dys[1..1035]} = 111.407;bswap2(), 1. BUILD: 15 41 9 after build: medoids are 9 15 41--> sky = sum_j D_j= 702.577Last swap: new 31 <-> 41 old; decreasing diss. by 0.561914end{bswap2}: sky = 590.348new best obj= 12.6975- clara sample 5 if (kall && nunfs...):.. kall: T, nsel[ntt=3] = 11[ntt=46, nunfs=0] -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(), 1. BUILD: 27 12 45 after build: medoids are 12 27 45--> sky = sum_j D_j= 810.101Last swap: new 21 <-> 33 old; decreasing diss. by 0.313188end{bswap2}: sky = 559.796obj= 13.7493C clara() -> best sample _found_ ; nbest[1:46] =c(1,3,8,11,12,20,23,25,27,29,32,37,40,41,44,46,47,48,51,52,53,54,56,61,64,66,74,77,81,88,90,92,94,95,96,97,101,104,106,107,110,114,115,116,118,120)resul(), black() and return() from C.> cx3.3 <- clara(xc120, 3, trace = 3)C clara(): (nsam,nran,n) = (46,5,120);- clara sample 1 finding 1st... new k{ran}:.. kall: FALSE,... nrx [0:2]= 0 0 0... nsel[0:0]= 2[ntt=46, nunfs=0] .. nsel[1:46]= 2 5 7 9 12 14 16 20 25 26 27 32 33 34 35 37 38 42 48 52 58 64 65 69 72 73 78 81 83 84 87 90 92 93 96 99 100 103 104 105 106 108 109 110 111 120 -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(*, s=115.819), 1. BUILD: new repr. 7new repr. 20new repr. 44after build: medoids are 7 20 44and min.dist dysma[1:n] are35.4 25.1 17.2 45.5 31.6 22.8 0 14.5 13 40.717.1 13.8 34 4.46 26.3 16.7 22.8 15.2 5.33 08.82 28.1 28.7 18.1 8.11 5.51 6.57 8.57 2.58 6.019.96 11.2 24.1 21.3 12.9 5.18 6.63 8.49 20.3 4.6412.1 3.79 13.9 0 13.1 21.1--> sky = sum_j D_j= 711.359swp new 3 <-> 7 old; decreasing diss. by -140.634Last swap: new 3 <-> 7 old; decreasing diss. by 1end{bswap2}: sky = 570.7251st proper sample obj= 13.4142- clara sample 2 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 7 52 110... nsel[0:2]= 7 52 110[ntt=46, nunfs=0] .. nsel[1:46]= 2 4 7 8 9 12 16 18 23 26 35 37 38 39 41 52 53 57 58 61 64 67 71 73 74 75 77 78 80 81 82 83 84 87 91 92 97 100 102 104 105 107 109 110 112 115 -> dysta2();clara -> s:= max{dys[1..1035]} = 114.718;bswap2(*, s=114.718), 1. BUILD: new repr. 17new repr. 44new repr. 9after build: medoids are 9 17 44and min.dist dysma[1:n] are7.72 10 11.9 5.68 26.6 10.8 28.2 20.3 0 14.510.9 31.1 11.7 34.8 22.4 21.6 0 18.9 21.2 8.3610.6 24.9 28.9 26 29.2 18.8 14.4 18.6 31.7 13.521.9 21.1 15.6 31.5 14.7 24.1 19.8 6.63 13.8 20.34.64 16.6 13.9 0 10.3 17.8--> sky = sum_j D_j= 786.108swp new 33 <-> 17 old; decreasing diss. by -168.839Last swap: new 33 <-> 17 old; decreasing diss. by 1end{bswap2}: sky = 617.268new best obj= 13.349- clara sample 3 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 23 84 110... nsel[0:2]= 23 84 110[ntt=46, nunfs=0] .. nsel[1:46]= 1 2 4 5 8 9 13 17 18 21 22 23 24 26 27 39 41 43 44 49 52 53 55 60 63 64 65 66 70 72 73 77 81 84 87 89 90 91 99 102 104 105 108 110 112 118 -> dysta2();clara -> s:= max{dys[1..1035]} = 109.395;bswap2(*, s=109.395), 1. BUILD: new repr. 27new repr. 11new repr. 44after build: medoids are 11 27 44and min.dist dysma[1:n] are12.6 18.9 16 8.1 6.03 31.1 15.1 5.77 9.37 16.90 11.3 10.7 25 1.54 38.7 22.1 34.8 4.99 17.128.7 12.9 21.6 17.7 27.1 21.6 0 38.5 15.9 23.434 25 20.3 23.5 37.5 28 11.2 14.7 5.18 13.820.3 4.64 3.79 0 10.3 8.28--> sky = sum_j D_j= 774.014swp new 33 <-> 27 old; decreasing diss. by -218.738swp new 5 <-> 11 old; decreasing diss. by -23.0466Last swap: new 5 <-> 11 old; decreasing diss. by 1end{bswap2}: sky = 532.229new best obj= 12.8491- clara sample 4 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 8 81 110... nsel[0:2]= 8 81 110[ntt=46, nunfs=0] .. nsel[1:46]= 1 3 8 11 12 20 23 25 27 29 32 37 40 41 44 46 47 48 51 52 53 54 56 61 64 66 74 77 81 88 90 92 94 95 96 97 101 104 106 107 110 114 115 116 118 120 -> dysta2();clara -> s:= max{dys[1..1035]} = 111.407;bswap2(*, s=111.407), 1. BUILD: new repr. 15new repr. 41new repr. 9after build: medoids are 9 15 41and min.dist dysma[1:n] are12.8 9 6.37 10.4 16.7 5.34 11.1 9.52 0 4.4315.8 36.9 10.6 19.5 0 14.1 13.9 29.1 17.9 24.28.48 7.37 14 8.44 18.2 36.4 24.5 20 15.7 37.611.2 24.1 27 17.9 12.9 19.8 1.78 20.3 12.1 16.60 22.9 17.8 10.2 8.28 21.1--> sky = sum_j D_j= 702.577swp new 29 <-> 15 old; decreasing diss. by -112.229Last swap: new 31 <-> 41 old; decreasing diss. by 0.561914end{bswap2}: sky = 590.348new best obj= 12.6975- clara sample 5 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 27 81 110... nsel[0:2]= 27 81 110[ntt=46, nunfs=0] .. nsel[1:46]= 2 3 4 6 9 10 11 15 18 19 21 27 28 30 31 35 38 42 45 46 50 51 52 53 56 61 62 64 69 70 73 77 81 83 87 91 96 103 104 107 110 111 112 116 118 119 -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(*, s=115.819), 1. BUILD: new repr. 27new repr. 12new repr. 45after build: medoids are 12 27 45and min.dist dysma[1:n] are18.5 9 14.9 2.66 32.3 10.7 10.4 12.8 9.21 11.618.3 0 19.7 24.9 2.77 12.7 15.4 46.5 16.8 25.222.6 27.9 33 11.7 15.3 17.9 0 14.4 47.4 24.137.6 26.1 24.5 32.2 42.8 18.2 16 2.98 12.2 8.38.28 13.3 10 7.83 0 20.9--> sky = sum_j D_j= 810.101swp new 33 <-> 27 old; decreasing diss. by -247.879swp new 8 <-> 12 old; decreasing diss. by -2.42584Last swap: new 21 <-> 33 old; decreasing diss. by 0.313188end{bswap2}: sky = 559.796obj= 13.7493C clara() -> best sample _found_ ; nbest[1:46] =c(1,3,8,11,12,20,23,25,27,29,32,37,40,41,44,46,47,48,51,52,53,54,56,61,64,66,74,77,81,88,90,92,94,95,96,97,101,104,106,107,110,114,115,116,118,120)resul(), black() and return() from C.> cx3.4 <- clara(xc120, 3, trace = 4)C clara(): (nsam,nran,n) = (46,5,120);- clara sample 1 finding 1st... new k{ran}:... {180}nrun= 999 -> k{ran}=2.. kall: FALSE,... nrx [0:2]= 0 0 0... nsel[0:0]= 2... {210}nrun=54606 -> k{ran}=100... {210}nrun=13365 -> k{ran}=25... {210}nrun=57500 -> k{ran}=106... {210}nrun=39555 -> k{ran}=73... {210}nrun= 8682 -> k{ran}=16... {210}nrun=14033 -> k{ran}=26... {210}nrun=39224 -> k{ran}=72... {210}nrun= 2335 -> k{ran}=5... {210}nrun=18054 -> k{ran}=34... {210}nrun= 4461 -> k{ran}=9... {210}nrun=10708 -> k{ran}=20... {210}nrun=20411 -> k{ran}=38... {210}nrun=17186 -> k{ran}=32... {210}nrun=50185 -> k{ran}=92... {210}nrun=37488 -> k{ran}=69... {210}nrun=28247 -> k{ran}=52... {210}nrun= 6078 -> k{ran}=12... {210}nrun=20133 -> k{ran}=37... {210}nrun=54028 -> k{ran}=99... {210}nrun=25843 -> k{ran}=48... {210}nrun=50266 -> k{ran}=93... {210}nrun=45377 -> k{ran}=84... {210}nrun=60328 -> k{ran}=111... {210}nrun=13199 -> k{ran}=25... {210}nrun=18678 -> k{ran}=35... {210}nrun=60381 -> k{ran}=111... {210}nrun=56388 -> k{ran}=104... {210}nrun=55851 -> k{ran}=103... {210}nrun=42386 -> k{ran}=78... {210}nrun=65145 -> k{ran}=120... {210}nrun=42208 -> k{ran}=78... {210}nrun=22727 -> k{ran}=42... {210}nrun=55854 -> k{ran}=103... {210}nrun=59669 -> k{ran}=110... {210}nrun=17788 -> k{ran}=33... {210}nrun=44899 -> k{ran}=83... {210}nrun=59082 -> k{ran}=109... {210}nrun=43953 -> k{ran}=81... {210}nrun=48664 -> k{ran}=90... {210}nrun=56831 -> k{ran}=105... {210}nrun=52070 -> k{ran}=96... {210}nrun=17997 -> k{ran}=33... {210}nrun= 3764 -> k{ran}=7... {210}nrun=58523 -> k{ran}=108... {210}nrun=34818 -> k{ran}=64... {210}nrun=47337 -> k{ran}=87... {210}nrun=14160 -> k{ran}=26... {210}nrun=49975 -> k{ran}=92... {210}nrun= 7326 -> k{ran}=14... {210}nrun= 901 -> k{ran}=2... {210}nrun=14316 -> k{ran}=27... {210}nrun=31187 -> k{ran}=58... {210}nrun=35130 -> k{ran}=65[ntt=46, nunfs=0] .. nsel[1:46]= 2 5 7 9 12 14 16 20 25 26 27 32 33 34 35 37 38 42 48 52 58 64 65 69 72 73 78 81 83 84 87 90 92 93 96 99 100 103 104 105 106 108 109 110 111 120 -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(*, s=115.819), 1. BUILD: new repr. 7new repr. 20new repr. 44after build: medoids are 7 20 44and min.dist dysma[1:n] are35.4 25.1 17.2 45.5 31.6 22.8 0 14.5 13 40.717.1 13.8 34 4.46 26.3 16.7 22.8 15.2 5.33 08.82 28.1 28.7 18.1 8.11 5.51 6.57 8.57 2.58 6.019.96 11.2 24.1 21.3 12.9 5.18 6.63 8.49 20.3 4.6412.1 3.79 13.9 0 13.1 21.1--> sky = sum_j D_j= 711.359swp new 3 <-> 7 old; decreasing diss. by -140.634Last swap: new 3 <-> 7 old; decreasing diss. by 1end{bswap2}: sky = 570.7251st proper sample obj= 13.4142- clara sample 2 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 7 52 110... nsel[0:2]= 7 52 110... {210}nrun= 9761 -> k{ran}=18... {210}nrun= 4232 -> k{ran}=8... {210}nrun= 2159 -> k{ran}=4... {210}nrun=52694 -> k{ran}=97... {210}nrun= 8381 -> k{ran}=16... {210}nrun=49444 -> k{ran}=91... {210}nrun=28427 -> k{ran}=53... {210}nrun=60018 -> k{ran}=110... {210}nrun=62297 -> k{ran}=115... {210}nrun=18880 -> k{ran}=35... {210}nrun=44455 -> k{ran}=82... {210}nrun=57102 -> k{ran}=105... {210}nrun=40437 -> k{ran}=75... {210}nrun=43612 -> k{ran}=80... {210}nrun=50243 -> k{ran}=92... {210}nrun=43946 -> k{ran}=81... {210}nrun= 8337 -> k{ran}=16... {210}nrun=58104 -> k{ran}=107... {210}nrun=45791 -> k{ran}=84... {210}nrun=20550 -> k{ran}=38... {210}nrun=31533 -> k{ran}=58... {210}nrun=62356 -> k{ran}=115... {210}nrun=31099 -> k{ran}=57... {210}nrun=52450 -> k{ran}=97... {210}nrun=44489 -> k{ran}=82... {210}nrun=56368 -> k{ran}=104... {210}nrun= 6167 -> k{ran}=12... {210}nrun= 8574 -> k{ran}=16... {210}nrun=47205 -> k{ran}=87... {210}nrun=40140 -> k{ran}=74... {210}nrun=36531 -> k{ran}=67... {210}nrun=19994 -> k{ran}=37... {210}nrun=39681 -> k{ran}=73... {210}nrun=13672 -> k{ran}=26... {210}nrun=56655 -> k{ran}=104... {210}nrun=21174 -> k{ran}=39... {210}nrun=21917 -> k{ran}=41... {210}nrun=42500 -> k{ran}=78... {210}nrun= 1003 -> k{ran}=2... {210}nrun=12114 -> k{ran}=23... {210}nrun=59449 -> k{ran}=109... {210}nrun=61088 -> k{ran}=112... {210}nrun= 647 -> k{ran}=2... {210}nrun=58350 -> k{ran}=107... {210}nrun=21205 -> k{ran}=39... {210}nrun= 3900 -> k{ran}=8... {210}nrun=55587 -> k{ran}=102... {210}nrun=28810 -> k{ran}=53... {210}nrun=38257 -> k{ran}=71... {210}nrun= 2008 -> k{ran}=4... {210}nrun=34751 -> k{ran}=64... {210}nrun=54566 -> k{ran}=100... {210}nrun=45069 -> k{ran}=83... {210}nrun=55412 -> k{ran}=102... {210}nrun= 3675 -> k{ran}=7... {210}nrun= 4546 -> k{ran}=9... {210}nrun=41641 -> k{ran}=77... {210}nrun=33040 -> k{ran}=61[ntt=46, nunfs=0] .. nsel[1:46]= 2 4 7 8 9 12 16 18 23 26 35 37 38 39 41 52 53 57 58 61 64 67 71 73 74 75 77 78 80 81 82 83 84 87 91 92 97 100 102 104 105 107 109 110 112 115 -> dysta2();clara -> s:= max{dys[1..1035]} = 114.718;bswap2(*, s=114.718), 1. BUILD: new repr. 17new repr. 44new repr. 9after build: medoids are 9 17 44and min.dist dysma[1:n] are7.72 10 11.9 5.68 26.6 10.8 28.2 20.3 0 14.510.9 31.1 11.7 34.8 22.4 21.6 0 18.9 21.2 8.3610.6 24.9 28.9 26 29.2 18.8 14.4 18.6 31.7 13.521.9 21.1 15.6 31.5 14.7 24.1 19.8 6.63 13.8 20.34.64 16.6 13.9 0 10.3 17.8--> sky = sum_j D_j= 786.108swp new 33 <-> 17 old; decreasing diss. by -168.839Last swap: new 33 <-> 17 old; decreasing diss. by 1end{bswap2}: sky = 617.268new best obj= 13.349- clara sample 3 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 23 84 110... nsel[0:2]= 23 84 110... {210}nrun=27895 -> k{ran}=52... {210}nrun= 9822 -> k{ran}=18... {210}nrun=27973 -> k{ran}=52... {210}nrun= 428 -> k{ran}=1... {210}nrun=41875 -> k{ran}=77... {210}nrun= 4858 -> k{ran}=9... {210}nrun= 4065 -> k{ran}=8... {210}nrun=23112 -> k{ran}=43... {210}nrun=45615 -> k{ran}=84... {210}nrun=55190 -> k{ran}=102... {210}nrun=35453 -> k{ran}=65... {210}nrun=35556 -> k{ran}=66... {210}nrun=39115 -> k{ran}=72... {210}nrun=29746 -> k{ran}=55... {210}nrun=56601 -> k{ran}=104... {210}nrun=37760 -> k{ran}=70... {210}nrun=22375 -> k{ran}=41... {210}nrun=59598 -> k{ran}=110... {210}nrun= 1973 -> k{ran}=4... {210}nrun=29724 -> k{ran}=55... {210}nrun=60931 -> k{ran}=112... {210}nrun=13674 -> k{ran}=26... {210}nrun= 2641 -> k{ran}=5... {210}nrun=11448 -> k{ran}=21... {210}nrun=23711 -> k{ran}=44... {210}nrun=23046 -> k{ran}=43... {210}nrun=58605 -> k{ran}=108... {210}nrun=48468 -> k{ran}=89... {210}nrun=41787 -> k{ran}=77... {210}nrun=22178 -> k{ran}=41... {210}nrun=38793 -> k{ran}=72... {210}nrun= 9712 -> k{ran}=18... {210}nrun=49623 -> k{ran}=91... {210}nrun=11070 -> k{ran}=21... {210}nrun= 8741 -> k{ran}=17... {210}nrun=26252 -> k{ran}=49... {210}nrun=47219 -> k{ran}=87... {210}nrun=55258 -> k{ran}=102... {210}nrun=33985 -> k{ran}=63... {210}nrun=32552 -> k{ran}=60... {210}nrun=34575 -> k{ran}=64... {210}nrun=23670 -> k{ran}=44... {210}nrun=48989 -> k{ran}=90... {210}nrun=28612 -> k{ran}=53... {210}nrun=11691 -> k{ran}=22... {210}nrun=47378 -> k{ran}=87... {210}nrun=53753 -> k{ran}=99... {210}nrun=14432 -> k{ran}=27... {210}nrun=44103 -> k{ran}=81... {210}nrun=60846 -> k{ran}=112... {210}nrun=48277 -> k{ran}=89... {210}nrun=55548 -> k{ran}=102... {210}nrun= 739 -> k{ran}=2... {210}nrun=64074 -> k{ran}=118... {210}nrun=32561 -> k{ran}=60... {210}nrun=20888 -> k{ran}=39... {210}nrun=12671 -> k{ran}=24... {210}nrun=57062 -> k{ran}=105... {210}nrun= 6605 -> k{ran}=13... {210}nrun=41524 -> k{ran}=77... {210}nrun=14363 -> k{ran}=27... {210}nrun=39810 -> k{ran}=73[ntt=46, nunfs=0] .. nsel[1:46]= 1 2 4 5 8 9 13 17 18 21 22 23 24 26 27 39 41 43 44 49 52 53 55 60 63 64 65 66 70 72 73 77 81 84 87 89 90 91 99 102 104 105 108 110 112 118 -> dysta2();clara -> s:= max{dys[1..1035]} = 109.395;bswap2(*, s=109.395), 1. BUILD: new repr. 27new repr. 11new repr. 44after build: medoids are 11 27 44and min.dist dysma[1:n] are12.6 18.9 16 8.1 6.03 31.1 15.1 5.77 9.37 16.90 11.3 10.7 25 1.54 38.7 22.1 34.8 4.99 17.128.7 12.9 21.6 17.7 27.1 21.6 0 38.5 15.9 23.434 25 20.3 23.5 37.5 28 11.2 14.7 5.18 13.820.3 4.64 3.79 0 10.3 8.28--> sky = sum_j D_j= 774.014swp new 33 <-> 27 old; decreasing diss. by -218.738swp new 5 <-> 11 old; decreasing diss. by -23.0466Last swap: new 5 <-> 11 old; decreasing diss. by 1end{bswap2}: sky = 532.229new best obj= 12.8491- clara sample 4 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 8 81 110... nsel[0:2]= 8 81 110... {210}nrun=35945 -> k{ran}=66... {210}nrun=51920 -> k{ran}=96... {210}nrun= 5815 -> k{ran}=11... {210}nrun=12318 -> k{ran}=23... {210}nrun=55045 -> k{ran}=101... {210}nrun=52076 -> k{ran}=96... {210}nrun=52563 -> k{ran}=97... {210}nrun=40122 -> k{ran}=74... {210}nrun=63905 -> k{ran}=118... {210}nrun=41992 -> k{ran}=77... {210}nrun=23535 -> k{ran}=44... {210}nrun=57686 -> k{ran}=106... {210}nrun=62525 -> k{ran}=115... {210}nrun=21668 -> k{ran}=40... {210}nrun=49803 -> k{ran}=92... {210}nrun=65010 -> k{ran}=120... {210}nrun=50905 -> k{ran}=94... {210}nrun=56640 -> k{ran}=104... {210}nrun= 295 -> k{ran}=1... {210}nrun=62094 -> k{ran}=114... {210}nrun=29045 -> k{ran}=54... {210}nrun=15836 -> k{ran}=29... {210}nrun= 6083 -> k{ran}=12... {210}nrun=48938 -> k{ran}=90... {210}nrun=62481 -> k{ran}=115... {210}nrun=30328 -> k{ran}=56... {210}nrun= 1631 -> k{ran}=3... {210}nrun=25542 -> k{ran}=47... {210}nrun=20141 -> k{ran}=37... {210}nrun=34580 -> k{ran}=64... {210}nrun=52475 -> k{ran}=97... {210}nrun=57442 -> k{ran}=106... {210}nrun=33097 -> k{ran}=61... {210}nrun=28592 -> k{ran}=53... {210}nrun=27543 -> k{ran}=51... {210}nrun=13566 -> k{ran}=25... {210}nrun=35813 -> k{ran}=66... {210}nrun=12364 -> k{ran}=23... {210}nrun=57907 -> k{ran}=107... {210}nrun=24986 -> k{ran}=46... {210}nrun=28289 -> k{ran}=52... {210}nrun=51432 -> k{ran}=95... {210}nrun=12495 -> k{ran}=23... {210}nrun=26166 -> k{ran}=48... {210}nrun=10525 -> k{ran}=20... {210}nrun=14724 -> k{ran}=27... {210}nrun=22379 -> k{ran}=41... {210}nrun=17106 -> k{ran}=32... {210}nrun=48057 -> k{ran}=88... {210}nrun=33312 -> k{ran}=61... {210}nrun=22023 -> k{ran}=41... {210}nrun=63342 -> k{ran}=116[ntt=46, nunfs=0] .. nsel[1:46]= 1 3 8 11 12 20 23 25 27 29 32 37 40 41 44 46 47 48 51 52 53 54 56 61 64 66 74 77 81 88 90 92 94 95 96 97 101 104 106 107 110 114 115 116 118 120 -> dysta2();clara -> s:= max{dys[1..1035]} = 111.407;bswap2(*, s=111.407), 1. BUILD: new repr. 15new repr. 41new repr. 9after build: medoids are 9 15 41and min.dist dysma[1:n] are12.8 9 6.37 10.4 16.7 5.34 11.1 9.52 0 4.4315.8 36.9 10.6 19.5 0 14.1 13.9 29.1 17.9 24.28.48 7.37 14 8.44 18.2 36.4 24.5 20 15.7 37.611.2 24.1 27 17.9 12.9 19.8 1.78 20.3 12.1 16.60 22.9 17.8 10.2 8.28 21.1--> sky = sum_j D_j= 702.577swp new 29 <-> 15 old; decreasing diss. by -112.229Last swap: new 31 <-> 41 old; decreasing diss. by 0.561914end{bswap2}: sky = 590.348new best obj= 12.6975- clara sample 5 if (kall && nunfs...):.. kall: T,... nrx [0:2]= 27 81 110... nsel[0:2]= 27 81 110... {210}nrun= 9813 -> k{ran}=18... {210}nrun=41660 -> k{ran}=77... {210}nrun=11427 -> k{ran}=21... {210}nrun=33802 -> k{ran}=62... {210}nrun=26865 -> k{ran}=50... {210}nrun=39768 -> k{ran}=73... {210}nrun=56127 -> k{ran}=103... {210}nrun=59558 -> k{ran}=110... {210}nrun=33677 -> k{ran}=62... {210}nrun=27636 -> k{ran}=51... {210}nrun=25051 -> k{ran}=46... {210}nrun= 9538 -> k{ran}=18... {210}nrun=30249 -> k{ran}=56... {210}nrun= 5264 -> k{ran}=10... {210}nrun=49271 -> k{ran}=91... {210}nrun=14814 -> k{ran}=28... {210}nrun=16581 -> k{ran}=31... {210}nrun=38188 -> k{ran}=70... {210}nrun=63251 -> k{ran}=116... {210}nrun= 9850 -> k{ran}=19... {210}nrun=58209 -> k{ran}=107... {210}nrun=60872 -> k{ran}=112... {210}nrun= 1455 -> k{ran}=3... {210}nrun=60182 -> k{ran}=111... {210}nrun=24061 -> k{ran}=45... {210}nrun= 7780 -> k{ran}=15... {210}nrun=60491 -> k{ran}=111... {210}nrun=34738 -> k{ran}=64... {210}nrun=45209 -> k{ran}=83... {210}nrun= 9984 -> k{ran}=19... {210}nrun=43751 -> k{ran}=81... {210}nrun=64590 -> k{ran}=119... {210}nrun=56117 -> k{ran}=103... {210}nrun= 1948 -> k{ran}=4... {210}nrun=16771 -> k{ran}=31... {210}nrun=18666 -> k{ran}=35... {210}nrun=56785 -> k{ran}=104... {210}nrun=49208 -> k{ran}=91... {210}nrun=45087 -> k{ran}=83... {210}nrun=28038 -> k{ran}=52... {210}nrun=47213 -> k{ran}=87... {210}nrun=20692 -> k{ran}=38... {210}nrun=63163 -> k{ran}=116... {210}nrun=27170 -> k{ran}=50... {210}nrun=27401 -> k{ran}=51... {210}nrun=47472 -> k{ran}=87... {210}nrun= 5463 -> k{ran}=11... {210}nrun=16062 -> k{ran}=30... {210}nrun=62885 -> k{ran}=116... {210}nrun=64012 -> k{ran}=118... {210}nrun= 3059 -> k{ran}=6... {210}nrun=60250 -> k{ran}=111... {210}nrun=22593 -> k{ran}=42... {210}nrun= 4776 -> k{ran}=9... {210}nrun=55951 -> k{ran}=103... {210}nrun=28662 -> k{ran}=53... {210}nrun=37597 -> k{ran}=69... {210}nrun= 836 -> k{ran}=2... {210}nrun=33067 -> k{ran}=61... {210}nrun=52370 -> k{ran}=96[ntt=46, nunfs=0] .. nsel[1:46]= 2 3 4 6 9 10 11 15 18 19 21 27 28 30 31 35 38 42 45 46 50 51 52 53 56 61 62 64 69 70 73 77 81 83 87 91 96 103 104 107 110 111 112 116 118 119 -> dysta2();clara -> s:= max{dys[1..1035]} = 115.819;bswap2(*, s=115.819), 1. BUILD: new repr. 27new repr. 12new repr. 45after build: medoids are 12 27 45and min.dist dysma[1:n] are18.5 9 14.9 2.66 32.3 10.7 10.4 12.8 9.21 11.618.3 0 19.7 24.9 2.77 12.7 15.4 46.5 16.8 25.222.6 27.9 33 11.7 15.3 17.9 0 14.4 47.4 24.137.6 26.1 24.5 32.2 42.8 18.2 16 2.98 12.2 8.38.28 13.3 10 7.83 0 20.9--> sky = sum_j D_j= 810.101swp new 33 <-> 27 old; decreasing diss. by -247.879swp new 8 <-> 12 old; decreasing diss. by -2.42584Last swap: new 21 <-> 33 old; decreasing diss. by 0.313188end{bswap2}: sky = 559.796obj= 13.7493C clara() -> best sample _found_ ; nbest[1:46] =c(1,3,8,11,12,20,23,25,27,29,32,37,40,41,44,46,47,48,51,52,53,54,56,61,64,66,74,77,81,88,90,92,94,95,96,97,101,104,106,107,110,114,115,116,118,120)resul(), black() and return() from C.> if(FALSE) # no change+ cx3.5 <- clara(xc120, 3, trace = 5)>> ###--- End version of example(clara) ------->> ## Last Line:> cat('Time elapsed: ', proc.time() - .proctime00,'\n')Time elapsed: 0.36 0.02 0.397 0 0>> proc.time()user system elapsed0.476 0.072 0.581