changeset 7:d56ce97c4985 draft

Uploaded
author deepakjadmin
date Thu, 05 Jan 2017 12:03:33 -0500
parents b84589b7c014
children 0cfbd42227cc
files feature_selection.R
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/feature_selection.R	Tue Jan 03 02:30:32 2017 -0500
+++ b/feature_selection.R	Thu Jan 05 12:03:33 2017 -0500
@@ -9,7 +9,9 @@
 arg7 <- args[7]
 arg8 <- args[8]
 arg9 <- args[9]
+arg10 <- args[10]
 library(caret)
+library(doMC)
 load(arg1)
 
 #RAWDATA <- dataX
@@ -133,7 +135,7 @@
 
 
 
- 
+if (as.numeric(arg10) == 1){ 
 Profile <- rfe(dx, dy,sizes = subsets,rfeControl = ctrl1)
 
 pred11 <- predictors(Profile)
@@ -144,4 +146,19 @@
 save(dataX,dataY,file=arg3)
 rm(dataX)
 rm(dataY)
+} else if (as.numeric(arg10) > 1){
+registerDoMC(cores = as.numeric(arg10))
 
+Profile <- rfe(dx, dy,sizes = subsets,rfeControl = ctrl1)
+
+pred11 <- predictors(Profile)
+save(Profile,file=arg2)
+dataX <- rawData[,pred11]
+dataY <- rawData$outcome
+
+save(dataX,dataY,file=arg3)
+rm(dataX)
+rm(dataY)
+} else { stop("something went wrong. please see the parameters")}  
+
+