Skip to content

Instantly share code, notes, and snippets.

@rvndbalaji
Last active July 24, 2018 15:34
Show Gist options
  • Save rvndbalaji/80a8d9271a1568a1040a1ec86cc4bc8e to your computer and use it in GitHub Desktop.
Save rvndbalaji/80a8d9271a1568a1040a1ec86cc4bc8e to your computer and use it in GitHub Desktop.
#Install the pakages if you haven't already done so
install.packages('nnet')
nnet = neuralnet(Occupancy ~ Temperature + Humidity + Light + CO2 + HumidityRatio,data=train,linear.output = FALSE,hidden = c(3,2))
#Predicted values
pred = compute(nnet,test[,-6])
pred = pred$net.result
#From the graph, for all predictions greater than 0.7 1 else 0
pred[pred>=0.7] = 1
pred[pred<0.7] = 0
pred = factor(pred)
plot(pred)
print(round(perf(pred,test$Occupancy),5)* 100)
#Output : 0.9556757727
#Execution Time : 1.6 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment