Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1418 396 79 30 94 146283 0.69 869 297 58 28 103 98364 0.81 1530 559 60 38 93 86146 0.49 2172 967 108 30 103 96933 0.54 901 270 49 22 51 79234 0.64 463 143 0 26 70 42551 0.81 3201 1562 121 25 91 195663 0.51 371 109 1 18 22 6853 0.21 1192 371 20 11 38 21529 0.21 1583 656 43 26 93 95757 0.64 1439 511 69 25 60 85584 0.52 1764 655 78 38 123 143983 0.61 1495 465 86 44 148 75851 0.44 1373 525 44 30 90 59238 0.44 2187 885 104 40 124 93163 0.36 1491 497 63 34 70 96037 0.53 4041 1436 158 47 168 151511 0.47 1706 612 102 30 115 136368 0.59 2152 865 77 31 71 112642 0.48 1036 385 82 23 66 94728 0.70 1882 567 115 36 134 105499 0.52 1929 639 101 36 117 121527 0.56 2242 963 80 30 108 127766 0.37 1220 398 50 25 84 98958 0.64 1289 410 83 39 156 77900 0.59 2515 966 123 34 120 85646 0.49 2147 801 73 31 114 98579 0.57 2352 892 81 31 94 130767 0.58 1638 513 105 33 120 131741 0.59 1222 469 47 25 81 53907 0.43 1812 683 105 33 110 178812 0.81 1677 643 94 35 133 146761 0.70 1579 535 44 42 122 82036 0.48 1731 625 114 43 158 163253 0.63 807 264 38 30 109 27032 0.32 2452 992 107 33 124 171975 0.58 829 238 30 13 39 65990 0.65 1940 818 71 32 92 86572 0.40 2662 937 84 36 126 159676 0.49 186 70 0 0 0 1929 0.27 1499 507 59 28 70 85371 0.51 865 260 33 14 37 58391 0.55 1793 503 42 17 38 31580 0.33 2527 927 96 32 120 136815 0.51 2747 1269 106 30 93 120642 0.45 1324 537 56 35 95 69107 0.46 2702 910 57 20 77 50495 0.29 1383 532 59 28 90 108016 0.71 1179 345 39 28 80 46341 0.42 2099 918 34 39 31 78348 0.67 4308 1635 76 34 110 79336 0.22 918 330 20 26 66 56968 0.72 1831 557 91 39 138 93176 0.51 3373 1178 115 39 133 161632 0.58 1713 740 85 33 113 87850 0.58 1438 452 76 28 100 127969 0.76 496 218 8 4 7 15049 0.62 2253 764 79 39 140 155135 0.47 744 255 21 18 61 25109 0.39 1161 454 30 14 41 45824 0.45 2352 866 76 29 96 102996 0.47 2144 574 101 44 164 160604 0.66 4691 1276 94 21 78 158051 0.46 1112 379 27 16 49 44547 0.43 2694 825 92 28 102 162647 0.70 1973 798 123 35 124 174141 0.68 1769 663 75 28 99 60622 0.29 3148 1069 128 38 129 179566 0.58 2474 921 105 23 62 184301 0.78 2084 858 55 36 73 75661 0.43 1954 711 56 32 114 96144 0.46 1226 503 41 29 99 129847 0.66 1389 382 72 25 70 117286 0.67 1496 464 67 27 104 71180 0.50 2269 717 75 36 116 109377 0.58 1833 690 114 28 91 85298 0.45 1268 462 118 23 74 73631 0.62 1943 657 77 40 138 86767 0.48 893 385 22 23 67 23824 0.32 1762 577 66 40 151 93487 0.48 1403 619 69 28 72 82981 0.50 1425 479 105 34 120 73815 0.51 1857 817 116 33 115 94552 0.34 1840 752 88 28 105 132190 0.54 1502 430 73 34 104 128754 0.70 1441 451 99 30 108 66363 0.49 1420 537 62 33 98 67808 0.45 1416 519 53 22 69 61724 0.51 2970 1000 118 38 111 131722 0.38 1317 637 30 26 99 68580 0.47 1644 465 100 35 71 106175 0.55 870 437 49 8 27 55792 0.69 1654 711 24 24 69 25157 0.20 1054 299 67 29 107 76669 0.59 937 248 46 20 73 57283 0.51 3004 1162 57 29 107 105805 0.37 2008 714 75 45 93 129484 0.54 2547 905 135 37 129 72413 0.49 1885 649 68 33 69 87831 0.43 1626 512 124 33 118 96971 0.53 1468 472 33 25 73 71299 0.51 2445 905 98 32 119 77494 0.35 1964 786 58 29 104 120336 0.50 1381 489 68 28 107 93913 0.58 1369 479 81 28 99 136048 0.75 1659 617 131 31 90 181248 0.78 2888 925 110 52 197 146123 0.55 1290 351 37 21 36 32036 0.37 2845 1144 130 24 85 186646 0.60 1982 669 93 41 139 102255 0.45 1904 707 118 33 106 168237 0.72 1391 458 39 32 50 64219 0.44 602 214 13 19 64 19630 0.45 1743 599 74 20 31 76825 0.49 1559 572 81 31 63 115338 0.70 2014 897 109 31 92 109427 0.54 2143 819 151 32 106 118168 0.50 2146 720 51 18 63 84845 0.38 874 273 28 23 69 153197 1.54 1590 508 40 17 41 29877 0.32 1590 506 56 20 56 63506 0.48 1210 451 27 12 25 22445 0.37 2072 699 37 17 65 47695 0.38 1281 407 83 30 93 68370 0.68 1401 465 54 31 114 146304 0.65 834 245 27 10 38 38233 0.46 1105 370 28 13 44 42071 0.41 1272 316 59 22 87 50517 0.50 1944 603 133 42 110 103950 0.43 391 154 12 1 0 5841 0.25 761 229 0 9 27 2341 0.06 1605 577 106 32 83 84396 0.55 530 192 23 11 30 24610 0.40 1988 617 44 25 80 35753 0.36 1386 411 71 36 98 55515 0.42 2395 975 116 31 82 209056 0.66 387 146 4 0 0 6622 0.31 1742 705 62 24 60 115814 0.55 620 184 12 13 28 11609 0.51 449 200 18 8 9 13155 0.42 800 274 14 13 33 18274 0.39 1684 502 60 19 59 72875 0.55 1050 382 7 18 49 10112 0.11 2699 964 98 33 115 142775 0.58 1606 537 64 40 140 68847 0.37 1502 438 29 22 49 17659 0.22 1204 369 32 38 120 20112 0.16 1138 417 25 24 66 61023 0.62 568 276 16 8 21 13983 0.37 1459 514 48 35 124 65176 0.43 2158 822 100 43 152 132432 0.49 1111 389 46 43 139 112494 0.65 1421 466 45 14 38 45109 0.42 2833 1255 129 41 144 170875 0.52 1955 694 130 38 120 180759 0.72 2922 1024 136 45 160 214921 0.61 1002 400 59 31 114 100226 0.63 1060 397 25 13 39 32043 0.32 956 350 32 28 78 54454 0.64 2186 719 63 31 119 78876 0.34 3604 1277 95 40 141 170745 0.49 1035 356 14 30 101 6940 0.08 1417 457 36 16 56 49025 0.41 3261 1402 113 37 133 122037 0.38 1587 600 47 30 83 53782 0.41 1424 480 92 35 116 127748 0.63 1701 595 70 32 90 86839 0.52 1249 436 19 27 36 44830 0.32 946 230 50 20 50 77395 0.67 1926 651 41 18 61 89324 0.36 3352 1367 91 31 97 103300 0.34 1641 564 111 31 98 112283 0.57 2035 716 41 21 78 10901 0.06 2312 747 120 39 117 120691 0.47 1369 467 135 41 148 58106 0.56 1577 671 27 13 41 57140 0.42 2201 861 87 32 105 122422 0.61 961 319 25 18 55 25899 0.28 1900 612 131 39 132 139296 0.62 1254 433 45 14 44 52678 0.39 1335 434 29 7 21 23853 0.32 1597 503 58 17 50 17306 0.21 207 85 4 0 0 7953 0.54 1645 564 47 30 73 89455 0.49 2429 824 109 37 86 147866 0.54 151 74 7 0 0 4245 0.59 474 259 12 5 13 21509 0.46 141 69 0 1 4 7670 0.44 1639 535 37 16 57 66675 0.50 872 239 37 32 48 14336 0.15 1318 438 46 24 46 53608 0.35 1018 459 15 17 48 30059 0.31 1383 426 42 11 32 29668 0.37 1314 288 7 24 68 22097 0.37 1335 498 54 22 87 96841 0.69 1403 454 54 12 43 41907 0.35 910 376 14 19 67 27080 0.37 616 225 16 13 46 35885 0.55 1407 555 33 17 46 41247 0.41 771 252 32 15 56 28313 0.39 766 208 21 16 48 36845 0.48 473 130 15 24 44 16548 0.34 1376 481 38 15 60 36134 0.27 1232 389 22 17 65 55764 0.51 1521 565 28 18 55 28910 0.32 572 173 10 20 38 13339 0.30 1059 278 31 16 52 25319 0.33 1544 609 32 16 60 66956 0.37 1230 422 32 18 54 47487 0.35 1206 445 43 22 86 52785 0.43 1205 387 27 8 24 44683 0.48 1255 339 37 17 52 35619 0.29 613 181 20 18 49 21920 0.41 721 245 32 16 61 45608 0.56 1109 384 0 23 61 7721 0.13 740 212 5 22 81 20634 0.39 1126 399 26 13 43 29788 0.49 728 229 10 13 40 31931 0.57 689 224 27 16 40 37754 0.58 592 203 11 16 56 32505 0.40 995 333 29 20 68 40557 0.53 1613 384 25 22 79 94238 0.91 2048 636 55 17 47 44197 0.45 705 185 23 18 57 43228 0.64 301 93 5 17 41 4103 0.13 1803 581 43 12 29 44144 0.33 799 248 23 7 3 32868 0.45 861 304 34 17 60 27640 0.44 1186 344 36 14 30 14063 0.23 1451 407 35 23 79 28990 0.39 628 170 0 17 47 4694 0.15 1161 312 37 14 40 42648 0.52 1463 507 28 15 48 64329 0.74 742 224 16 17 36 21928 0.44 979 340 26 21 42 25836 0.39 675 168 38 18 49 22779 0.40 1241 443 23 18 57 40820 0.26 676 204 22 17 12 27530 0.59 1049 367 30 17 40 32378 0.44 620 210 16 16 43 10824 0.28 1081 335 18 15 33 39613 0.43 1688 364 28 21 77 60865 0.44 736 178 32 16 43 19787 0.38 617 206 21 14 45 20107 0.39 812 279 23 15 47 36605 0.52 1051 387 29 17 43 40961 0.48 1656 490 50 15 45 48231 0.47 705 238 12 15 50 39725 0.46 945 343 21 10 35 21455 0.25 554 232 18 6 7 23430 0.68 1597 530 27 22 71 62991 0.42 982 291 41 21 67 49363 0.50 222 67 13 1 0 9604 0.50 1212 397 12 18 62 24552 0.25 1143 467 21 17 54 31493 0.37 435 178 8 4 4 3439 0.11 532 175 26 10 25 19555 0.62 882 299 27 16 40 21228 0.24 608 154 13 16 38 23177 0.37 459 106 16 9 19 22094 0.55 578 189 2 16 17 2342 0.08 826 194 42 17 67 38798 0.50 509 135 5 7 14 3255 0.09 717 201 37 15 30 24261 0.45 637 207 17 14 54 18511 0.37 857 280 38 14 35 40798 0.48 830 260 37 18 59 28893 0.45 652 227 29 12 24 21425 0.36 707 239 32 16 58 50276 0.42 954 333 35 21 42 37643 0.49 1461 428 17 19 46 30377 0.29 672 230 20 16 61 27126 0.39 778 292 7 1 3 13 0.00 1141 350 46 16 52 42097 0.40 680 186 24 10 25 24451 0.39 1090 326 40 19 40 14335 0.21 616 155 3 12 32 5084 0.10 285 75 10 2 4 9927 0.50 1145 361 37 14 49 43527 0.50 733 261 17 17 63 27184 0.32 888 299 28 19 67 21610 0.28 849 300 19 14 32 20484 0.23 1182 450 29 11 23 20156 0.22 528 183 8 4 7 6012 0.15 642 238 10 16 54 18475 0.29 947 165 15 20 37 12645 0.25 819 234 15 12 35 11017 0.19 757 176 28 15 51 37623 0.60 894 329 17 16 39 35873 0.49
Names of X columns:
page comp blogcomp review fdm120 totsec prod
Endogenous Variable (Column Number)
Categorization
Do not include Seasonal Dummies
none
quantiles
hclust
equal
Number of categories (only if categorization<>none)
Cross-Validation? (only if categorization<>none)
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