#!/usr/bin/env Rscript
library(randomForest)
load("noHB_C.RData")
testFeats <- read.table("./descriptor.sre")
colnames(testFeats) <- c("V2","V3","V4","V5","V6","V7","V8","V9","V10","V11","V12","V13","V14","V15","V16","V17","V18","V19","V20","V21","V22","V23","V24","V25","V26","V27","V28","V29","V30","V31","V32","V33","V34","V35","V36","V37","V38","V39","V40","V41","V42","V43","V44","V45","V46")
testPred     <- predict(RF1, newdata = testFeats)
totalpred = testPred
testPred     <- predict(RF2, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF3, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF4, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF5, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF6, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF7, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF8, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF9, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
testPred     <- predict(RF10, newdata = testFeats)
totalpred = cbind(totalpred, testPred)
pred = 10 - (rowSums(totalpred)-10)
if (pred > 5){ pred2 <- 1 } else { pred2 <- 0 }
write(pred2,"prediction.pred")
