Commit bdfc1eea authored by Anand Gavai's avatar Anand Gavai
Browse files

Changed variable names closing #issue 6

parent f487b666
Pipeline #746 skipped
......@@ -39,6 +39,8 @@ brix[idxRound,"class"]<-rep("round",length(idxRound))
brix<-na.omit(brix)
head(brix)
### Check the distribution of each class
......@@ -69,6 +71,7 @@ length(grep("^R",brix[,1],value=TRUE) )
traits<-read.csv("traits.csv",header=TRUE)
traits<-na.omit(traits)
head(traits)
### New distribution after removing empty fields
### each tomato type ####
......@@ -108,13 +111,13 @@ combined_data<-combined_data[,-highlyCorrelated]
## Create Data partition
inTrain <- createDataPartition(y = combined_data$class,p = .75,list = FALSE)
combined_data <- combined_data[ inTrain,]
training <- combined_data[ inTrain,]
testing <- combined_data[-inTrain,]
# STEP 3: Model training
train_control <- trainControl(method="repeatedcv", number=10,repeats=10,classProbs=TRUE,savePred=TRUE)
model_rf <- train(combined_data[,20]~., data=combined_data[,1:19], trControl=train_control, method="rf", ntree=100)
model_rf <- train(training[,20]~., data=training[,1:19], trControl=train_control, method="rf", ntree=100)
### Rank features by importance
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment