Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
210907 1418 396 79 30 112285 144 146283 94 120982 869 297 58 28 84786 103 98364 103 176508 1530 559 60 38 83123 98 86146 93 179321 2172 967 108 30 101193 135 96933 103 123185 901 270 49 22 38361 61 79234 51 52746 463 143 0 26 68504 39 42551 70 385534 3201 1562 121 25 119182 150 195663 91 33170 371 109 1 18 22807 5 6853 22 101645 1192 371 20 11 17140 28 21529 38 149061 1583 656 43 26 116174 84 95757 93 165446 1439 511 69 25 57635 80 85584 60 237213 1764 655 78 38 66198 130 143983 123 173326 1495 465 86 44 71701 82 75851 148 133131 1373 525 44 30 57793 60 59238 90 258873 2187 885 104 40 80444 131 93163 124 180083 1491 497 63 34 53855 84 96037 70 324799 4041 1436 158 47 97668 140 151511 168 230964 1706 612 102 30 133824 151 136368 115 236785 2152 865 77 31 101481 91 112642 71 135473 1036 385 82 23 99645 138 94728 66 202925 1882 567 115 36 114789 150 105499 134 215147 1929 639 101 36 99052 124 121527 117 344297 2242 963 80 30 67654 119 127766 108 153935 1220 398 50 25 65553 73 98958 84 132943 1289 410 83 39 97500 110 77900 156 174724 2515 966 123 34 69112 123 85646 120 174415 2147 801 73 31 82753 90 98579 114 225548 2352 892 81 31 85323 116 130767 94 223632 1638 513 105 33 72654 113 131741 120 124817 1222 469 47 25 30727 56 53907 81 221698 1812 683 105 33 77873 115 178812 110 210767 1677 643 94 35 117478 119 146761 133 170266 1579 535 44 42 74007 129 82036 122 260561 1731 625 114 43 90183 127 163253 158 84853 807 264 38 30 61542 27 27032 109 294424 2452 992 107 33 101494 175 171975 124 101011 829 238 30 13 27570 35 65990 39 215641 1940 818 71 32 55813 64 86572 92 325107 2662 937 84 36 79215 96 159676 126 7176 186 70 0 0 1423 0 1929 0 167542 1499 507 59 28 55461 84 85371 70 106408 865 260 33 14 31081 41 58391 37 96560 1793 503 42 17 22996 47 31580 38 265769 2527 927 96 32 83122 126 136815 120 269651 2747 1269 106 30 70106 105 120642 93 149112 1324 537 56 35 60578 80 69107 95 175824 2702 910 57 20 39992 70 50495 77 152871 1383 532 59 28 79892 73 108016 90 111665 1179 345 39 28 49810 57 46341 80 116408 2099 918 34 39 71570 40 78348 31 362301 4308 1635 76 34 100708 68 79336 110 78800 918 330 20 26 33032 21 56968 66 183167 1831 557 91 39 82875 127 93176 138 277965 3373 1178 115 39 139077 154 161632 133 150629 1713 740 85 33 71595 116 87850 113 168809 1438 452 76 28 72260 102 127969 100 24188 496 218 8 4 5950 7 15049 7 329267 2253 764 79 39 115762 148 155135 140 65029 744 255 21 18 32551 21 25109 61 101097 1161 454 30 14 31701 35 45824 41 218946 2352 866 76 29 80670 112 102996 96 244052 2144 574 101 44 143558 137 160604 164 341570 4691 1276 94 21 117105 135 158051 78 103597 1112 379 27 16 23789 26 44547 49 233328 2694 825 92 28 120733 230 162647 102 256462 1973 798 123 35 105195 181 174141 124 206161 1769 663 75 28 73107 71 60622 99 311473 3148 1069 128 38 132068 147 179566 129 235800 2474 921 105 23 149193 190 184301 62 177939 2084 858 55 36 46821 64 75661 73 207176 1954 711 56 32 87011 105 96144 114 196553 1226 503 41 29 95260 107 129847 99 174184 1389 382 72 25 55183 94 117286 70 143246 1496 464 67 27 106671 116 71180 104 187559 2269 717 75 36 73511 106 109377 116 187681 1833 690 114 28 92945 143 85298 91 119016 1268 462 118 23 78664 81 73631 74 182192 1943 657 77 40 70054 89 86767 138 73566 893 385 22 23 22618 26 23824 67 194979 1762 577 66 40 74011 84 93487 151 167488 1403 619 69 28 83737 113 82981 72 143756 1425 479 105 34 69094 120 73815 120 275541 1857 817 116 33 93133 110 94552 115 243199 1840 752 88 28 95536 134 132190 105 182999 1502 430 73 34 225920 54 128754 104 135649 1441 451 99 30 62133 96 66363 108 152299 1420 537 62 33 61370 78 67808 98 120221 1416 519 53 22 43836 51 61724 69 346485 2970 1000 118 38 106117 121 131722 111 145790 1317 637 30 26 38692 38 68580 99 193339 1644 465 100 35 84651 145 106175 71 80953 870 437 49 8 56622 59 55792 27 122774 1654 711 24 24 15986 27 25157 69 130585 1054 299 67 29 95364 91 76669 107 112611 937 248 46 20 26706 48 57283 73 286468 3004 1162 57 29 89691 68 105805 107 241066 2008 714 75 45 67267 58 129484 93 148446 2547 905 135 37 126846 150 72413 129 204713 1885 649 68 33 41140 74 87831 69 182079 1626 512 124 33 102860 181 96971 118 140344 1468 472 33 25 51715 65 71299 73 220516 2445 905 98 32 55801 97 77494 119 243060 1964 786 58 29 111813 121 120336 104 162765 1381 489 68 28 120293 99 93913 107 182613 1369 479 81 28 138599 152 136048 99 232138 1659 617 131 31 161647 188 181248 90 265318 2888 925 110 52 115929 138 146123 197 85574 1290 351 37 21 24266 40 32036 36 310839 2845 1144 130 24 162901 254 186646 85 225060 1982 669 93 41 109825 87 102255 139 232317 1904 707 118 33 129838 178 168237 106 144966 1391 458 39 32 37510 51 64219 50 43287 602 214 13 19 43750 49 19630 64 155754 1743 599 74 20 40652 73 76825 31 164709 1559 572 81 31 87771 176 115338 63 201940 2014 897 109 31 85872 94 109427 92 235454 2143 819 151 32 89275 120 118168 106 220801 2146 720 51 18 44418 66 84845 63 99466 874 273 28 23 192565 56 153197 69 92661 1590 508 40 17 35232 39 29877 41 133328 1590 506 56 20 40909 66 63506 56 61361 1210 451 27 12 13294 27 22445 25 125930 2072 699 37 17 32387 65 47695 65 100750 1281 407 83 30 140867 58 68370 93 224549 1401 465 54 31 120662 98 146304 114 82316 834 245 27 10 21233 25 38233 38 102010 1105 370 28 13 44332 26 42071 44 101523 1272 316 59 22 61056 77 50517 87 243511 1944 603 133 42 101338 130 103950 110 22938 391 154 12 1 1168 11 5841 0 41566 761 229 0 9 13497 2 2341 27 152474 1605 577 106 32 65567 101 84396 83 61857 530 192 23 11 25162 31 24610 30 99923 1988 617 44 25 32334 36 35753 80 132487 1386 411 71 36 40735 120 55515 98 317394 2395 975 116 31 91413 195 209056 82 21054 387 146 4 0 855 4 6622 0 209641 1742 705 62 24 97068 89 115814 60 22648 620 184 12 13 44339 24 11609 28 31414 449 200 18 8 14116 39 13155 9 46698 800 274 14 13 10288 14 18274 33 131698 1684 502 60 19 65622 78 72875 59 91735 1050 382 7 18 16563 15 10112 49 244749 2699 964 98 33 76643 106 142775 115 184510 1606 537 64 40 110681 83 68847 140 79863 1502 438 29 22 29011 24 17659 49 128423 1204 369 32 38 92696 37 20112 120 97839 1138 417 25 24 94785 77 61023 66 38214 568 276 16 8 8773 16 13983 21 151101 1459 514 48 35 83209 56 65176 124 272458 2158 822 100 43 93815 132 132432 152 172494 1111 389 46 43 86687 144 112494 139 108043 1421 466 45 14 34553 40 45109 38 328107 2833 1255 129 41 105547 153 170875 144 250579 1955 694 130 38 103487 143 180759 120 351067 2922 1024 136 45 213688 220 214921 160 158015 1002 400 59 31 71220 79 100226 114 98866 1060 397 25 13 23517 50 32043 39 85439 956 350 32 28 56926 39 54454 78 229242 2186 719 63 31 91721 95 78876 119 351619 3604 1277 95 40 115168 169 170745 141 84207 1035 356 14 30 111194 12 6940 101 120445 1417 457 36 16 51009 63 49025 56 324598 3261 1402 113 37 135777 134 122037 133 131069 1587 600 47 30 51513 69 53782 83 204271 1424 480 92 35 74163 119 127748 116 165543 1701 595 70 32 51633 119 86839 90 141722 1249 436 19 27 75345 75 44830 36 116048 946 230 50 20 33416 63 77395 50 250047 1926 651 41 18 83305 55 89324 61 299775 3352 1367 91 31 98952 103 103300 97 195838 1641 564 111 31 102372 197 112283 98 173260 2035 716 41 21 37238 16 10901 78 254488 2312 747 120 39 103772 140 120691 117 104389 1369 467 135 41 123969 89 58106 148 136084 1577 671 27 13 27142 40 57140 41 199476 2201 861 87 32 135400 125 122422 105 92499 961 319 25 18 21399 21 25899 55 224330 1900 612 131 39 130115 167 139296 132 135781 1254 433 45 14 24874 32 52678 44 74408 1335 434 29 7 34988 36 23853 21 81240 1597 503 58 17 45549 13 17306 50 14688 207 85 4 0 6023 5 7953 0 181633 1645 564 47 30 64466 96 89455 73 271856 2429 824 109 37 54990 151 147866 86 7199 151 74 7 0 1644 6 4245 0 46660 474 259 12 5 6179 13 21509 13 17547 141 69 0 1 3926 3 7670 4 133368 1639 535 37 16 32755 57 66675 57 95227 872 239 37 32 34777 23 14336 48 152601 1318 438 46 24 73224 61 53608 46 98146 1018 459 15 17 27114 21 30059 48 79619 1383 426 42 11 20760 43 29668 32 59194 1314 288 7 24 37636 20 22097 68 139942 1335 498 54 22 65461 82 96841 87 118612 1403 454 54 12 30080 90 41907 43 72880 910 376 14 19 24094 25 27080 67
Names of X columns:
time_in_rfc pageviews compendium_views_info blogged_computations compendiums_reviewed totale_size totale_hyperlinks totale_seconds feedback_messages_p120
Endogenous Variable (Column Number)
Categorization
none
none
quantiles
hclust
equal
Number of categories (only if categorization<>none)
Cross-Validation? (only if categorization<>none)
no
no
yes
Chart options
R Code
library(party) library(Hmisc) par1 <- as.numeric(par1) par3 <- as.numeric(par3) x <- data.frame(t(y)) is.data.frame(x) x <- x[!is.na(x[,par1]),] k <- length(x[1,]) n <- length(x[,1]) colnames(x)[par1] x[,par1] if (par2 == 'kmeans') { cl <- kmeans(x[,par1], par3) print(cl) clm <- matrix(cbind(cl$centers,1:par3),ncol=2) clm <- clm[sort.list(clm[,1]),] for (i in 1:par3) { cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='') } cl$cluster <- as.factor(cl$cluster) print(cl$cluster) x[,par1] <- cl$cluster } if (par2 == 'quantiles') { x[,par1] <- cut2(x[,par1],g=par3) } if (par2 == 'hclust') { hc <- hclust(dist(x[,par1])^2, 'cen') print(hc) memb <- cutree(hc, k = par3) dum <- c(mean(x[memb==1,par1])) for (i in 2:par3) { dum <- c(dum, mean(x[memb==i,par1])) } hcm <- matrix(cbind(dum,1:par3),ncol=2) hcm <- hcm[sort.list(hcm[,1]),] for (i in 1:par3) { memb[memb==hcm[i,2]] <- paste('C',i,sep='') } memb <- as.factor(memb) print(memb) x[,par1] <- memb } if (par2=='equal') { ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep='')) x[,par1] <- as.factor(ed) } table(x[,par1]) colnames(x) colnames(x)[par1] x[,par1] if (par2 == 'none') { m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) } load(file='createtable') if (par2 != 'none') { m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x) if (par4=='yes') { a<-table.start() a<-table.row.start(a) a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'',1,TRUE) a<-table.element(a,'Prediction (training)',par3+1,TRUE) a<-table.element(a,'Prediction (testing)',par3+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Actual',1,TRUE) for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) a<-table.element(a,'CV',1,TRUE) for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) a<-table.element(a,'CV',1,TRUE) a<-table.row.end(a) for (i in 1:10) { ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1)) m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,]) if (i==1) { m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,]) m.ct.i.actu <- x[ind==1,par1] m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,]) m.ct.x.actu <- x[ind==2,par1] } else { m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,])) m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1]) m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,])) m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1]) } } print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred)) numer <- 0 for (i in 1:par3) { print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,])) numer <- numer + m.ct.i.tab[i,i] } print(m.ct.i.cp <- numer / sum(m.ct.i.tab)) print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred)) numer <- 0 for (i in 1:par3) { print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,])) numer <- numer + m.ct.x.tab[i,i] } print(m.ct.x.cp <- numer / sum(m.ct.x.tab)) for (i in 1:par3) { a<-table.row.start(a) a<-table.element(a,paste('C',i,sep=''),1,TRUE) for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj]) a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4)) for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj]) a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4)) a<-table.row.end(a) } a<-table.row.start(a) a<-table.element(a,'Overall',1,TRUE) for (jjj in 1:par3) a<-table.element(a,'-') a<-table.element(a,round(m.ct.i.cp,4)) for (jjj in 1:par3) a<-table.element(a,'-') a<-table.element(a,round(m.ct.x.cp,4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.tab') } } m bitmap(file='test1.png') plot(m) dev.off() bitmap(file='test1a.png') plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') dev.off() if (par2 == 'none') { forec <- predict(m) result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) colnames(result) <- c('Actuals','Forecasts','Residuals') print(result) } if (par2 != 'none') { print(cbind(as.factor(x[,par1]),predict(m))) myt <- table(as.factor(x[,par1]),predict(m)) print(myt) } bitmap(file='test2.png') if(par2=='none') { op <- par(mfrow=c(2,2)) plot(density(result$Actuals),main='Kernel Density Plot of Actuals') plot(density(result$Residuals),main='Kernel Density Plot of Residuals') plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals') plot(density(result$Forecasts),main='Kernel Density Plot of Predictions') par(op) } if(par2!='none') { plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted') } dev.off() if (par2 == 'none') { detcoef <- cor(result$Forecasts,result$Actuals) a<-table.start() a<-table.row.start(a) a<-table.element(a,'Goodness of Fit',2,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Correlation',1,TRUE) a<-table.element(a,round(detcoef,4)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'R-squared',1,TRUE) a<-table.element(a,round(detcoef*detcoef,4)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'RMSE',1,TRUE) a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable1.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'#',header=TRUE) a<-table.element(a,'Actuals',header=TRUE) a<-table.element(a,'Forecasts',header=TRUE) a<-table.element(a,'Residuals',header=TRUE) a<-table.row.end(a) for (i in 1:length(result$Actuals)) { a<-table.row.start(a) a<-table.element(a,i,header=TRUE) a<-table.element(a,result$Actuals[i]) a<-table.element(a,result$Forecasts[i]) a<-table.element(a,result$Residuals[i]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable.tab') } if (par2 != 'none') { a<-table.start() a<-table.row.start(a) a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'',1,TRUE) for (i in 1:par3) { a<-table.element(a,paste('C',i,sep=''),1,TRUE) } a<-table.row.end(a) for (i in 1:par3) { a<-table.row.start(a) a<-table.element(a,paste('C',i,sep=''),1,TRUE) for (j in 1:par3) { a<-table.element(a,myt[i,j]) } a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable2.tab') }
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
2 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation