Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1 119.992 74.997 0.0037 1 122.4 113.819 0.00465 1 116.682 111.555 0.00544 1 116.676 111.366 0.00502 1 116.014 110.655 0.00655 1 120.552 113.787 0.00463 1 120.267 114.82 0.00155 1 107.332 104.315 0.00144 1 95.73 91.754 0.00293 1 95.056 91.226 0.00268 1 88.333 84.072 0.00254 1 91.904 86.292 0.00281 1 136.926 131.276 0.00118 1 139.173 76.556 0.00165 1 152.845 75.836 0.00121 1 142.167 83.159 0.00157 1 144.188 82.764 0.00211 1 168.778 75.603 0.00284 1 153.046 68.623 0.00364 1 156.405 142.822 0.00372 1 153.848 65.782 0.00428 1 153.88 78.128 0.00232 1 167.93 79.068 0.0022 1 173.917 86.18 0.00221 1 163.656 76.779 0.0038 1 104.4 77.968 0.00316 1 171.041 75.501 0.0025 1 146.845 81.737 0.0025 1 155.358 80.055 0.00159 1 162.568 77.63 0.0028 0 197.076 192.055 0.00166 0 199.228 192.091 0.00134 0 198.383 193.104 0.00113 0 202.266 197.079 0.00093 0 203.184 196.16 0.00094 0 201.464 195.708 0.00105 1 177.876 168.013 0.00233 1 176.17 163.564 0.00205 1 180.198 175.456 0.00153 1 187.733 173.015 0.00168 1 186.163 177.584 0.00165 1 184.055 166.977 0.00134 0 237.226 225.227 0.00169 0 241.404 232.483 0.00157 0 243.439 232.435 0.00109 0 242.852 227.911 0.00117 0 245.51 231.848 0.00127 0 252.455 182.786 0.00092 0 122.188 115.765 0.00169 0 122.964 114.676 0.00124 0 124.445 117.495 0.00141 0 126.344 112.773 0.00131 0 128.001 122.08 0.00137 0 129.336 118.604 0.00165 1 108.807 102.874 0.00349 1 109.86 104.437 0.00398 1 110.417 103.37 0.00352 1 117.274 110.402 0.00299 1 116.879 108.153 0.00334 1 114.847 104.68 0.00373 0 209.144 109.379 0.00147 0 223.365 98.664 0.00154 0 222.236 205.495 0.00152 0 228.832 223.634 0.00175 0 229.401 221.156 0.00114 0 228.969 113.201 0.00136 1 140.341 67.021 0.0043 1 136.969 66.004 0.00507 1 143.533 65.809 0.00647 1 148.09 67.343 0.00467 1 142.729 65.476 0.00469 1 136.358 65.75 0.00534 1 120.08 111.208 0.0018 1 112.014 107.024 0.00268 1 110.793 107.316 0.0026 1 110.707 105.007 0.00277 1 112.876 106.981 0.0027 1 110.568 106.821 0.00226 1 95.385 90.264 0.00331 1 100.77 85.545 0.00622 1 96.106 84.51 0.00389 1 95.605 87.549 0.00428 1 100.96 95.628 0.00351 1 98.804 87.804 0.00247 1 176.858 75.344 0.00418 1 180.978 155.495 0.0022 1 178.222 141.047 0.00163 1 176.281 125.61 0.00287 1 173.898 74.677 0.00237 1 179.711 144.878 0.00391 1 166.605 78.032 0.00387 1 151.955 147.226 0.00224 1 148.272 142.299 0.0025 1 152.125 76.596 0.00191 1 157.821 68.401 0.00196 1 157.447 149.605 0.00201 1 159.116 144.811 0.00178 1 125.036 116.187 0.00743 1 125.791 96.206 0.00826 1 126.512 99.77 0.01159 1 125.641 116.346 0.02144 1 128.451 75.632 0.00905 1 139.224 66.157 0.01854 1 150.258 75.349 0.00105 1 154.003 128.621 0.00076 1 149.689 133.608 0.00116 1 155.078 144.148 0.00068 1 151.884 133.751 0.00115 1 151.989 132.857 0.00075 1 193.03 80.297 0.0045 1 200.714 89.686 0.00371 1 208.519 199.02 0.00368 1 204.664 189.621 0.00502 1 210.141 185.258 0.00321 1 206.327 92.02 0.00302 1 151.872 69.085 0.00404 1 158.219 71.948 0.00214 1 170.756 79.032 0.00244 1 178.285 82.063 0.00157 1 217.116 93.978 0.00127 1 128.94 88.251 0.00241 1 176.824 83.961 0.00209 1 138.19 83.34 0.00406 1 182.018 79.187 0.00506 1 156.239 79.82 0.00403 1 145.174 80.637 0.00414 1 138.145 81.114 0.00294 1 166.888 79.512 0.00368 1 119.031 109.216 0.00214 1 120.078 105.667 0.00116 1 120.289 100.209 0.00269 1 120.256 104.773 0.00224 1 119.056 86.795 0.00169 1 118.747 109.836 0.00168 1 106.516 93.105 0.00291 1 110.453 105.554 0.00244 1 113.4 107.816 0.00219 1 113.166 100.673 0.00257 1 112.239 104.095 0.00238 1 116.15 109.815 0.00181 1 170.368 79.543 0.00232 1 208.083 91.802 0.00428 1 198.458 148.691 0.00182 1 202.805 86.232 0.00189 1 202.544 164.168 0.001 1 223.361 87.638 0.00169 1 169.774 151.451 0.00863 1 183.52 161.34 0.00849 1 188.62 165.982 0.00996 1 202.632 177.258 0.00919 1 186.695 149.442 0.01075 1 192.818 168.793 0.018 1 198.116 174.478 0.01568 1 121.345 98.25 0.00388 1 119.1 88.833 0.00393 1 117.87 95.654 0.00356 1 122.336 94.794 0.00415 1 117.963 100.757 0.01117 1 126.144 97.543 0.00593 1 127.93 112.173 0.00321 1 114.238 77.022 0.00299 1 115.322 107.802 0.00352 1 114.554 91.121 0.00366 1 112.15 97.527 0.00291 1 102.273 85.902 0.00493 0 236.2 102.137 0.00154 0 237.323 229.256 0.00173 0 260.105 237.303 0.00205 0 197.569 90.794 0.0049 0 240.301 219.783 0.00316 0 244.99 239.17 0.00279 0 112.547 105.715 0.00166 0 110.739 100.139 0.0017 0 113.715 96.913 0.00171 0 117.004 99.923 0.00176 0 115.38 108.634 0.0016 0 116.388 108.97 0.00169 1 151.737 129.859 0.00135 1 148.79 138.99 0.00152 1 148.143 135.041 0.00204 1 150.44 144.736 0.00206 1 148.462 141.998 0.00202 1 149.818 144.786 0.00174 0 117.226 106.656 0.00186 0 116.848 99.503 0.0026 0 116.286 96.983 0.00134 0 116.556 86.228 0.00254 0 116.342 94.246 0.00115 0 114.563 86.647 0.00146 0 201.774 78.228 0.00412 0 174.188 94.261 0.00263 0 209.516 89.488 0.00331 0 174.688 74.287 0.00624 0 198.764 74.904 0.0037 0 214.289 77.973 0.00295
Names of X columns:
status MDVP:Fo(Hz) MDVP:Flo(Hz) MDVP:RAP
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
par4 <- 'no' par3 <- '3' par2 <- 'none' par1 <- '1' 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
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation