Rev 8273 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
R Under development (unstable) (2023-10-19 r85354) -- "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.> 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(144)> 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.499522 -1.944452[2,] 48.629631 12.998515Objective function: 10.23588Numerical information per cluster:size max_diss av_diss isolation[1,] 70 24.81995 10.25745 0.4744879[2,] 20 19.07782 10.16040 0.3647145Average silhouette width per cluster:[1] 0.7144587 0.7090915Average silhouette width of best sample: 0.713266Best 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_width45 1 2 0.803372760 1 2 0.802101755 1 2 0.800593166 1 2 0.800277658 1 2 0.799189911 1 2 0.799177341 1 2 0.797330226 1 2 0.796239763 1 2 0.796222913 1 2 0.794970567 1 2 0.794259054 1 2 0.793618417 1 2 0.791608716 1 2 0.791357039 1 2 0.79127556 1 2 0.784045534 1 2 0.783356849 1 2 0.78197339 1 2 0.778908723 1 2 0.778500932 1 2 0.775732522 1 2 0.765536961 1 2 0.763975412 1 2 0.76396445 1 2 0.760643618 1 2 0.757914556 1 2 0.75663073 1 2 0.753789424 1 2 0.753118050 1 2 0.751781748 1 2 0.750199825 1 2 0.749965559 1 2 0.747202219 1 2 0.744503865 1 2 0.739839528 1 2 0.737737738 1 2 0.73709357 1 2 0.733594040 1 2 0.731001214 1 2 0.729489562 1 2 0.725447870 1 2 0.71632144 1 2 0.715725721 1 2 0.714866364 1 2 0.71084962 1 2 0.706283115 1 2 0.701512052 1 2 0.697831337 1 2 0.695402331 1 2 0.693290533 1 2 0.688847810 1 2 0.680502820 1 2 0.676685443 1 2 0.67614618 1 2 0.674970627 1 2 0.667181735 1 2 0.663288868 1 2 0.658759930 1 2 0.655498936 1 2 0.622848153 1 2 0.620331357 1 2 0.619166642 1 2 0.614202047 1 2 0.60241511 1 2 0.581446469 1 2 0.509118646 1 2 0.496130244 1 2 0.484996129 1 2 0.456931651 1 2 0.423018181 2 1 0.796594271 2 1 0.796197185 2 1 0.791959374 2 1 0.786904782 2 1 0.779530478 2 1 0.778887379 2 1 0.772904172 2 1 0.749298088 2 1 0.744797387 2 1 0.740439976 2 1 0.735235177 2 1 0.721683886 2 1 0.716567784 2 1 0.695240673 2 1 0.694288283 2 1 0.662156880 2 1 0.636844690 2 1 0.574322875 2 1 0.559723289 2 1 0.44825494005 dissimilarities, summarized :Min. 1st Qu. Median Mean 3rd Qu. Max.0.1865 11.5850 20.0580 27.8150 45.5780 85.2320Metric : 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,] 2.012828 -1.896095[2,] 51.494628 10.274769Objective function: 10.23445Numerical information per cluster:size max_diss av_diss isolation[1,] 700 36.84408 10.49814 0.7230478[2,] 800 30.89896 10.00373 0.6063775Average silhouette width per cluster:[1] 0.7562366 0.7203254Average silhouette width of best sample: 0.733384Best sample:[1] 21 23 50 97 142 168 191 192 197 224 325 328 433 458 471[16] 651 712 714 722 797 805 837 909 919 926 999 1006 1018 1019 1049[31] 1081 1084 1132 1144 1150 1201 1207 1250 1291 1307 1330 1374 1426 1428Clustering 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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2 2 2 2 2 2 2 2 2 2 2 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 2 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_width325 1 2 0.8261589191 1 2 0.820668723 1 2 0.814964097 1 2 0.8048084433 1 2 0.8017745458 1 2 0.8008324471 1 2 0.7958547328 1 2 0.7689099142 1 2 0.761950821 1 2 0.7607528197 1 2 0.760664150 1 2 0.7509131192 1 2 0.7098473651 1 2 0.7035969224 1 2 0.6843886168 1 2 0.53370061084 2 1 0.81804471081 2 1 0.81716861201 2 1 0.81708471291 2 1 0.81671481307 2 1 0.81668411144 2 1 0.8159947999 2 1 0.81353031426 2 1 0.80235381049 2 1 0.80228911250 2 1 0.8014300712 2 1 0.7859324837 2 1 0.77927841018 2 1 0.7764837919 2 1 0.76519391374 2 1 0.76485341428 2 1 0.75168191330 2 1 0.75058611006 2 1 0.7368113714 2 1 0.72375651150 2 1 0.70460601132 2 1 0.6940608909 2 1 0.6859682926 2 1 0.6725631722 2 1 0.6572791797 2 1 0.63956981019 2 1 0.6083662805 2 1 0.28141641207 2 1 0.2694097946 dissimilarities, summarized :Min. 1st Qu. Median Mean 3rd Qu. Max.0.4846 12.3230 26.4990 32.2130 52.3910 77.1750Metric : 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] 10.06735$i.med[1] 177 1115$medoids[,1] [,2][1,] -0.2538744 -1.209148[2,] 50.0372683 9.501125$clusinfosize max_diss av_diss isolation[1,] 700 34.67208 10.193945 0.6743054[2,] 800 29.51964 9.956571 0.5741003> for(i in 1:20)+ print(clara(x[sample(nrow(x)),], 2, samples = 50)[clInd])$objective[1] 10.05727$i.med[1] 936 192$medoids[,1] [,2][1,] 50.03726827 9.501124850[2,] -0.03900399 -0.009078886$clusinfosize max_diss av_diss isolation[1,] 800 29.51964 9.956571 0.5791419[2,] 700 34.06055 10.172348 0.6682295$objective[1] 10.05296$i.med[1] 468 1394$medoids[,1] [,2][1,] -0.3292826 -0.2398794[2,] 50.0372683 9.5011249$clusinfosize max_diss av_diss isolation[1,] 700 33.98451 10.163128 0.6624677[2,] 800 29.51964 9.956571 0.5754330$objective[1] 10.05852$i.med[1] 1171 379$medoids[,1] [,2][1,] 50.9444060 9.6723175[2,] -0.3292826 -0.2398794$clusinfosize max_diss av_diss isolation[1,] 800 30.10388 9.966988 0.5764486[2,] 700 33.98451 10.163128 0.6507574$objective[1] 10.07051$i.med[1] 75 1254$medoids[,1] [,2][1,] -0.9493373 0.3552542[2,] 50.5455985 9.3904972$clusinfosize max_diss av_diss isolation[1,] 700 33.12704 10.191999 0.6336273[2,] 800 29.66384 9.964205 0.5673860$objective[1] 10.0613$i.med[1] 199 134$medoids[,1] [,2][1,] -0.03900399 -0.009078886[2,] 49.59384120 9.792964832$clusinfosize max_diss av_diss isolation[1,] 700 34.06055 10.172348 0.6732466[2,] 800 29.57491 9.964138 0.5845827$objective[1] 10.06101$i.med[1] 1453 1122$medoids[,1] [,2][1,] 50.0372683 9.50112485[2,] -0.9691441 0.03342515$clusinfosize max_diss av_diss isolation[1,] 800 29.51964 9.956571 0.5690241[2,] 700 33.31923 10.180359 0.6422655$objective[1] 10.08603$i.med[1] 613 318$medoids[,1] [,2][1,] 50.0627056 9.478225[2,] -0.2902194 1.026496$clusinfosize max_diss av_diss isolation[1,] 800 29.51131 9.957225 0.5780037[2,] 700 33.21560 10.233240 0.6505552$objective[1] 10.07293$i.med[1] 618 406$medoids[,1] [,2][1,] 50.3621263 9.0207185[2,] -0.2092816 -0.5916053$clusinfosize max_diss av_diss isolation[1,] 800 29.25143 9.990206 0.5682446[2,] 700 34.30301 10.167473 0.6663777$objective[1] 10.0592$i.med[1] 1279 1349$medoids[,1] [,2][1,] 50.1502433 10.60358224[2,] -0.9691441 0.03342515$clusinfosize max_diss av_diss isolation[1,] 800 30.54975 9.953191 0.5852356[2,] 700 33.31923 10.180359 0.6382900$objective[1] 10.06241$i.med[1] 1293 21$medoids[,1] [,2][1,] 50.5809098 9.7418386[2,] -0.9493373 0.3552542$clusinfosize max_diss av_diss isolation[1,] 800 29.98892 9.949013 0.5725461[2,] 700 33.12704 10.191999 0.6324587$objective[1] 10.0592$i.med[1] 337 675$medoids[,1] [,2][1,] -0.9691441 0.03342515[2,] 50.1502433 10.60358224$clusinfosize max_diss av_diss isolation[1,] 700 33.31923 10.180359 0.6382900[2,] 800 30.54975 9.953191 0.5852356$objective[1] 10.05697$i.med[1] 22 574$medoids[,1] [,2][1,] 50.5809098 9.74183863[2,] -0.9691441 0.03342515$clusinfosize max_diss av_diss isolation[1,] 800 29.98892 9.949013 0.5716937[2,] 700 33.31923 10.180359 0.6351809$objective[1] 10.05096$i.med[1] 739 808$medoids[,1] [,2][1,] 50.5809098 9.7418386[2,] -0.2092816 -0.5916053$clusinfosize max_diss av_diss isolation[1,] 800 29.98892 9.949013 0.5785936[2,] 700 34.30301 10.167473 0.6618278$objective[1] 10.06135$i.med[1] 1431 485$medoids[,1] [,2][1,] 50.0627056 9.47822525[2,] -0.9691441 0.03342515$clusinfosize max_diss av_diss isolation[1,] 800 29.51131 9.957225 0.5686352[2,] 700 33.31923 10.180359 0.6420076$objective[1] 10.05324$i.med[1] 10 1221$medoids[,1] [,2][1,] 50.58090982 9.741838628[2,] -0.03900399 -0.009078886$clusinfosize max_diss av_diss isolation[1,] 800 29.98892 9.949013 0.5817385[2,] 700 34.06055 10.172348 0.6607218$objective[1] 10.06101$i.med[1] 1249 1411$medoids[,1] [,2][1,] -0.9691441 0.03342515[2,] 50.0372683 9.50112485$clusinfosize max_diss av_diss isolation[1,] 700 33.31923 10.180359 0.6422655[2,] 800 29.51964 9.956571 0.5690241$objective[1] 10.05296$i.med[1] 610 21$medoids[,1] [,2][1,] -0.3292826 -0.2398794[2,] 50.0372683 9.5011249$clusinfosize max_diss av_diss isolation[1,] 700 33.98451 10.163128 0.6624677[2,] 800 29.51964 9.956571 0.5754330$objective[1] 10.06486$i.med[1] 1101 397$medoids[,1] [,2][1,] -0.9691441 0.03342515[2,] 50.1066826 9.35514422$clusinfosize max_diss av_diss isolation[1,] 700 33.31923 10.180359 0.6417479[2,] 800 29.42336 9.963794 0.5667111$objective[1] 10.07521$i.med[1] 838 356$medoids[,1] [,2][1,] 50.36212634 9.020718482[2,] -0.03900399 -0.009078886$clusinfosize max_diss av_diss isolation[1,] 800 29.25143 9.990206 0.5712766[2,] 700 34.06055 10.172348 0.6651980$objective[1] 10.05906$i.med[1] 1270 1024$medoids[,1] [,2][1,] 50.5455985 9.3904972[2,] -0.2092816 -0.5916053$clusinfosize max_diss av_diss isolation[1,] 800 29.66384 9.964205 0.5734673[2,] 700 34.30301 10.167473 0.6631526>> clara(x, 2, samples = 101)[clInd]$objective[1] 10.05727$i.med[1] 286 1115$medoids[,1] [,2][1,] -0.03900399 -0.009078886[2,] 50.03726827 9.501124850$clusinfosize max_diss av_diss isolation[1,] 700 34.06055 10.172348 0.6682295[2,] 800 29.51964 9.956571 0.5791419> clara(x, 2, samples = 149)[clInd]$objective[1] 10.05319$i.med[1] 238 1272$medoids[,1] [,2][1,] -0.2092816 -0.5916053[2,] 50.1502433 10.6035822$clusinfosize max_diss av_diss isolation[1,] 700 34.30301 10.167473 0.6649301[2,] 800 30.54975 9.953191 0.5921768> clara(x, 2, samples = 200)[clInd]$objective[1] 10.05319$i.med[1] 238 1272$medoids[,1] [,2][1,] -0.2092816 -0.5916053[2,] 50.1502433 10.6035822$clusinfosize max_diss av_diss isolation[1,] 700 34.30301 10.167473 0.6649301[2,] 800 30.54975 9.953191 0.5921768> ## Note that this last one is practically identical to the slower pam() one>> (ii <- sample(length(x), 20))[1] 249 452 2663 2537 2235 2421 1004 1834 2602 397 717 2805 1575 1281 283[16] 1657 1749 820 269 519> ## This was bogous (and lead to seg.faults); now properly gives error.> ## but for these, now see ./clara-NAs.R> if(FALSE) { ## ~~~~~~~~~~~~~+ x[ii] <- NA+ try( clara(x, 2, samples = 50) )+ }>> ###-- Larger example: 2000 objects, divided into 5 clusters.> x5 <- rbind(cbind(rnorm(400, 0,4), rnorm(400, 0,4)),+ cbind(rnorm(400,10,8), rnorm(400,40,6)),+ cbind(rnorm(400,30,4), rnorm(400, 0,4)),+ cbind(rnorm(400,40,4), rnorm(400,20,2)),+ cbind(rnorm(400,50,4), rnorm(400,50,4)))> ## plus 1 random dimension> x5 <- cbind(x5, rnorm(nrow(x5)))>> clara(x5, 5)Call: clara(x = x5, k = 5)Medoids:[,1] [,2] [,3][1,] 0.5850466 -2.222194 -0.63631241[2,] 8.0131143 42.708122 -0.31693240[3,] 42.6657812 21.123133 -0.62411426[4,] 50.6470292 48.480686 -0.09146223[5,] 28.6470950 -2.544131 -0.22186047Objective function: 6.100721Clustering vector: int [1:2000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 400 396 408 401 395Best sample:[1] 23 130 178 202 267 297 338 357 376 387 439 441 638 647 662[16] 719 723 802 874 880 994 1038 1056 1097 1184 1215 1225 1268 1271 1282[31] 1346 1442 1446 1474 1496 1515 1585 1590 1605 1641 1680 1687 1696 1728 1742[46] 1761 1857 1909 1951 1956Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> summary(clara(x5, 5, samples = 50))Object of class 'clara' from call:clara(x = x5, k = 5, samples = 50)Medoids:[,1] [,2] [,3][1,] -0.8427864 0.1606105 -0.70362181[2,] 12.0389703 39.0303445 0.19158023[3,] 39.6341676 20.7182868 0.43978514[4,] 50.6470292 48.4806864 -0.09146223[5,] 30.6814242 -0.1072177 -0.25861548Objective function: 5.743812Numerical information per cluster:size max_diss av_diss isolation[1,] 400 15.20728 5.207177 0.4823345[2,] 397 24.25898 8.677062 0.7324727[3,] 406 18.39064 4.369617 0.8109074[4,] 401 18.28050 5.260543 0.6119680[5,] 396 12.69653 5.243478 0.5598344Average silhouette width per cluster:[1] 0.7433532 0.6956424 0.7315944 0.7336104 0.7079360Average silhouette width of best sample: 0.7188531Best sample:[1] 106 130 145 213 275 316 434 444 486 501 630 693 713 739 773[16] 804 808 821 823 899 914 948 961 972 980 987 1076 1114 1126 1127[31] 1169 1175 1203 1225 1228 1242 1269 1397 1405 1421 1595 1606 1658 1703 1777[46] 1834 1857 1881 1937 1999Clustering 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 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145 1 5 0.6641473630 2 3 0.7819320739 2 3 0.7774128486 2 3 0.7559683713 2 3 0.7316982444 2 3 0.7204625501 2 3 0.7091146773 2 1 0.6886472693 2 3 0.5855803434 2 3 0.50996541225 3 5 0.81057761203 3 5 0.79657731595 3 5 0.78427111269 3 5 0.77999311242 3 5 0.76254421397 3 5 0.73155121228 3 5 0.72620251421 3 5 0.60116161405 3 5 0.59147071999 4 3 0.80500461857 4 3 0.80307091658 4 3 0.79411411777 4 3 0.78652091937 4 3 0.78319961881 4 3 0.75047791834 4 3 0.66142231606 4 3 0.63738081703 4 3 0.5813025804 5 3 0.8021043987 5 3 0.79990641076 5 3 0.7907769948 5 3 0.7905304961 5 3 0.7716289823 5 3 0.7657693808 5 3 0.7510670914 5 3 0.73582311175 5 3 0.73374851169 5 3 0.7254812972 5 3 0.7118795821 5 3 0.7101558899 5 1 0.65809271114 5 3 0.65528871127 5 3 0.62924281126 5 3 0.5362475980 5 1 0.46716951225 dissimilarities, summarized :Min. 1st Qu. Median Mean 3rd Qu. Max.0.6968 19.3160 34.0920 33.0700 46.2540 92.2530Metric : euclideanNumber of objects : 50Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> ## 3 "half" samples:> clara(x5, 5, samples = 999)Call: clara(x = x5, k = 5, samples = 999)Medoids:[,1] [,2] [,3][1,] 0.2143499 0.3891695 0.45577894[2,] 10.9779485 39.6788652 -0.23487762[3,] 40.2944064 20.2221253 0.21417849[4,] 50.7170411 49.7645642 -0.43318939[5,] 29.7257398 -0.5981739 -0.05616701Objective function: 5.659041Clustering vector: int [1:2000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 400 397 407 401 395Best sample:[1] 1 2 103 147 155 176 179 247 262 288 365 369 372 470 486[16] 573 759 779 785 791 797 822 875 883 913 954 1107 1114 1154 1156[31] 1171 1175 1206 1213 1218 1233 1243 1394 1439 1444 1512 1741 1777 1798 1800[46] 1818 1845 1946 1948 1973Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> clara(x5, 5, samples = 1000)Call: clara(x = x5, k = 5, samples = 1000)Medoids:[,1] [,2] [,3][1,] 0.2143499 0.3891695 0.45577894[2,] 10.9779485 39.6788652 -0.23487762[3,] 40.2944064 20.2221253 0.21417849[4,] 50.7170411 49.7645642 -0.43318939[5,] 29.7257398 -0.5981739 -0.05616701Objective function: 5.659041Clustering vector: int [1:2000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 400 397 407 401 395Best sample:[1] 1 2 103 147 155 176 179 247 262 288 365 369 372 470 486[16] 573 759 779 785 791 797 822 875 883 913 954 1107 1114 1154 1156[31] 1171 1175 1206 1213 1218 1233 1243 1394 1439 1444 1512 1741 1777 1798 1800[46] 1818 1845 1946 1948 1973Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data"> clara(x5, 5, samples = 1001)Call: clara(x = x5, k = 5, samples = 1001)Medoids:[,1] [,2] [,3][1,] 0.2143499 0.3891695 0.45577894[2,] 10.9779485 39.6788652 -0.23487762[3,] 40.2944064 20.2221253 0.21417849[4,] 50.7170411 49.7645642 -0.43318939[5,] 29.7257398 -0.5981739 -0.05616701Objective function: 5.659041Clustering vector: int [1:2000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 400 397 407 401 395Best sample:[1] 1 2 103 147 155 176 179 247 262 288 365 369 372 470 486[16] 573 759 779 785 791 797 822 875 883 913 954 1107 1114 1154 1156[31] 1171 1175 1206 1213 1218 1233 1243 1394 1439 1444 1512 1741 1777 1798 1800[46] 1818 1845 1946 1948 1973Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data">> clara(x5, 5, samples = 2000)#full sampleCall: clara(x = x5, k = 5, samples = 2000)Medoids:[,1] [,2] [,3][1,] 0.2143499 0.3891695 0.45577894[2,] 10.5993345 39.8970536 -0.39199265[3,] 40.3370139 20.3148331 -0.06033818[4,] 50.7170411 49.7645642 -0.43318939[5,] 29.7257398 -0.5981739 -0.05616701Objective function: 5.65785Clustering vector: int [1:2000] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...Cluster sizes: 400 397 407 401 395Best sample:[1] 84 106 164 226 284 288 329 423 430 450 469 593 603 654 742[16] 887 929 970 974 1035 1043 1096 1171 1187 1192 1302 1307 1327 1371 1431[31] 1433 1439 1440 1452 1513 1522 1525 1548 1565 1593 1620 1639 1654 1688 1740[46] 1761 1832 1845 1895 1899Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data">> ###--- 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> ## ~~~~~~~~~~~~>> ###--- End version of example(clara) ------->> ## small example(s):> data(ruspini)>> clara(ruspini,4)Call: clara(x = ruspini, k = 4)Medoids:x y10 19 6532 44 14952 99 11967 66 18Objective function: 11.51066Clustering vector: Named int [1:75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...- attr(*, "names")= chr [1:75] "1" "2" "3" "4" "5" "6" "7" ...Cluster sizes: 20 23 17 15Best sample:[1] 2 3 4 5 6 7 8 9 10 16 18 19 20 21 22 23 25 29 30 32 34 35 36 37 41[26] 42 43 44 46 47 49 50 52 53 54 58 59 60 61 63 65 66 67 69 71 72 73 75Available components:[1] "sample" "medoids" "i.med" "clustering" "objective"[6] "clusinfo" "diss" "call" "silinfo" "data">> rus <- data.matrix(ruspini); storage.mode(rus) <- "double"> ru2 <- rus[c(1:7,21:28, 45:51, 61:69),]> ru3 <- rus[c(1:4,21:25, 45:48, 61:63),]> ru4 <- rus[c(1:2,21:22, 45:47),]> ru5 <- rus[c(1:2,21, 45),]> daisy(ru5, "manhattan")Dissimilarities :1 2 212 1121 118 10745 143 132 89Metric : manhattanNumber of objects : 4> ## Dissimilarities : 11 118 143 107 132 89>> ## no problem anymore, since 2002-12-28:> ## sampsize >= k+1 is now enforced:> ## clara(ru5, k=3, met="manhattan", sampsize=3,trace=2)[clInS]> clara(ru5, k=3, met="manhattan", sampsize=4,trace=1)[clInS]C clara(): (nsam,nran,n) = (4,5,4); 'full_sample',-> dysta2(); obj= 2.75resul(), black() and return() from C.$objective[1] 2.75$i.med[1] 2 3 4$medoidsx y2 5 6321 28 14745 85 115$clusinfosize max_diss av_diss isolation[1,] 2 11 5.5 0.1028037[2,] 1 0 0.0 0.0000000[3,] 1 0 0.0 0.0000000$sample[1] "1" "2" "21" "45">> daisy(ru4, "manhattan")Dissimilarities :1 2 21 22 45 462 1121 118 10722 124 113 645 143 132 89 8746 124 113 108 106 1947 115 104 103 101 28 9Metric : manhattanNumber of objects : 7> ## this one (k=3) gave problems, from ss = 6 on ___ still after 2002-12-28 ___ :> for(ss in 4:nrow(ru4)){+ cat("---\n\nsample size = ",ss,"\n")+ print(clara(ru4,k=3,met="manhattan",sampsize=ss)[clInS])+ }---sample size = 4$objective[1] 7.714286$i.med[1] 1 4 7$medoidsx y1 4 5322 32 14947 78 94$clusinfosize max_diss av_diss isolation[1,] 2 11 5.50000 0.09565217[2,] 2 6 3.00000 0.05940594[3,] 3 28 12.33333 0.27722772$sample[1] "1" "22" "45" "47"---sample size = 5$objective[1] 7.714286$i.med[1] 2 3 7$medoidsx y2 5 6321 28 14747 78 94$clusinfosize max_diss av_diss isolation[1,] 2 11 5.50000 0.10576923[2,] 2 6 3.00000 0.05825243[3,] 3 28 12.33333 0.27184466$sample[1] "2" "21" "22" "45" "47"---sample size = 6$objective[1] 6.428571$i.med[1] 2 4 6$medoidsx y2 5 6322 32 14946 85 96$clusinfosize max_diss av_diss isolation[1,] 2 11 5.500000 0.09734513[2,] 2 6 3.000000 0.05660377[3,] 3 19 9.333333 0.17924528$sample[1] "2" "21" "22" "45" "46" "47"---sample size = 7$objective[1] 6.428571$i.med[1] 2 4 6$medoidsx y2 5 6322 32 14946 85 96$clusinfosize max_diss av_diss isolation[1,] 2 11 5.500000 0.09734513[2,] 2 6 3.000000 0.05660377[3,] 3 19 9.333333 0.17924528$sample[1] "1" "2" "21" "22" "45" "46" "47"> for(ss in 5:nrow(ru3)){+ cat("---\n\nsample size = ",ss,"\n")+ print(clara(ru3,k=4,met="manhattan",sampsize=ss)[clInS])+ }---sample size = 5$objective[1] 13.625$i.med[1] 4 5 10 15$medoidsx y4 9 7721 28 14745 85 11562 77 12$clusinfosize max_diss av_diss isolation[1,] 4 29 16.50 0.3258427[2,] 5 14 9.00 0.1573034[3,] 4 30 19.25 0.3370787[4,] 3 15 10.00 0.1351351$sample[1] "3" "4" "21" "45" "62"---sample size = 6$objective[1] 9.0625$i.med[1] 3 7 13 15$medoidsx y3 10 5923 35 15348 74 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 19 10.00 0.1881188[2,] 5 13 5.60 0.1354167[3,] 4 30 11.75 0.3448276[4,] 3 15 10.00 0.1724138$sample[1] "3" "21" "23" "45" "48" "62"---sample size = 7$objective[1] 9.0625$i.med[1] 3 7 13 15$medoidsx y3 10 5923 35 15348 74 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 19 10.00 0.1881188[2,] 5 13 5.60 0.1354167[3,] 4 30 11.75 0.3448276[4,] 3 15 10.00 0.1724138$sample[1] "2" "3" "21" "23" "45" "48" "62"---sample size = 8$objective[1] 8.8125$i.med[1] 3 7 12 15$medoidsx y3 10 5923 35 15347 78 9462 77 12$clusinfosize max_diss av_diss isolation[1,] 4 19 10.00 0.1844660[2,] 5 13 5.60 0.1274510[3,] 4 28 10.75 0.3373494[4,] 3 15 10.00 0.1807229$sample[1] "3" "21" "23" "46" "47" "48" "61" "62"---sample size = 9$objective[1] 9.3125$i.med[1] 2 6 11 16$medoidsx y2 5 6322 32 14946 85 9663 83 21$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1592920[2,] 5 8 5.40 0.0754717[3,] 4 19 9.75 0.2467532[4,] 3 30 15.00 0.3896104$sample[1] "2" "21" "22" "23" "45" "46" "47" "61" "63"---sample size = 10$objective[1] 8.5625$i.med[1] 3 7 11 15$medoidsx y3 10 5923 35 15346 85 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 19 10.00 0.1696429[2,] 5 13 5.60 0.1214953[3,] 4 19 9.75 0.2065217[4,] 3 15 10.00 0.1630435$sample[1] "2" "3" "22" "23" "45" "46" "47" "61" "62" "63"---sample size = 11$objective[1] 8.6875$i.med[1] 2 7 12 15$medoidsx y2 5 6323 35 15347 78 9462 77 12$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1730769[2,] 5 13 5.60 0.1274510[3,] 4 28 10.75 0.3373494[4,] 3 15 10.00 0.1807229$sample[1] "1" "2" "3" "4" "23" "24" "25" "45" "47" "48" "62"---sample size = 12$objective[1] 8.8125$i.med[1] 3 7 12 15$medoidsx y3 10 5923 35 15347 78 9462 77 12$clusinfosize max_diss av_diss isolation[1,] 4 19 10.00 0.1844660[2,] 5 13 5.60 0.1274510[3,] 4 28 10.75 0.3373494[4,] 3 15 10.00 0.1807229$sample[1] "2" "3" "22" "23" "24" "25" "46" "47" "48" "61" "62" "63"---sample size = 13$objective[1] 8.4375$i.med[1] 2 7 11 15$medoidsx y2 5 6323 35 15346 85 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1592920[2,] 5 13 5.60 0.1214953[3,] 4 19 9.75 0.2065217[4,] 3 15 10.00 0.1630435$sample[1] "1" "2" "4" "22" "23" "24" "25" "45" "46" "47" "61" "62" "63"---sample size = 14$objective[1] 8.4375$i.med[1] 2 7 11 15$medoidsx y2 5 6323 35 15346 85 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1592920[2,] 5 13 5.60 0.1214953[3,] 4 19 9.75 0.2065217[4,] 3 15 10.00 0.1630435$sample[1] "2" "3" "4" "22" "23" "24" "25" "45" "46" "47" "48" "61" "62" "63"---sample size = 15$objective[1] 8.375$i.med[1] 2 6 11 15$medoidsx y2 5 6322 32 14946 85 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1592920[2,] 5 8 5.40 0.0754717[3,] 4 19 9.75 0.2065217[4,] 3 15 10.00 0.1630435$sample[1] "2" "3" "4" "21" "22" "23" "24" "25" "45" "46" "47" "48" "61" "62" "63"---sample size = 16$objective[1] 8.375$i.med[1] 2 6 11 15$medoidsx y2 5 6322 32 14946 85 9662 77 12$clusinfosize max_diss av_diss isolation[1,] 4 18 9.50 0.1592920[2,] 5 8 5.40 0.0754717[3,] 4 19 9.75 0.2065217[4,] 3 15 10.00 0.1630435$sample[1] "1" "2" "3" "4" "21" "22" "23" "24" "25" "45" "46" "47" "48" "61" "62"[16] "63">> ## Last Line:> cat('Time elapsed: ', proc.time() - .proctime00,'\n')Time elapsed: 1.4 0.013 1.433 0 0> ## Lynne (P IV, 1.6 GHz): 18.81; then (no NA; R 1.9.0-alpha): 15.07> ## nb-mm (P III,700 MHz): 27.97>> proc.time()user system elapsed1.674 0.102 1.917