Which part of the code is wrong for artificial neural network in R? [on hold]
Which part of the code is wrong for artificial neural network in R? [on hold] I'm trying to predict a sales demand by using artificial neural network and 10 fold cross validation. So, I coded by using nnet package as follows: library(nnet) library(plyr) k = 10 question$id <- sample(1:k, nrow(question), replace = TRUE) list <- 1:k prediction <- data.frame() testsetCopy <- data.frame() progress.bar <- create_progress_bar("text") progress.bar$init(k) for(i in 1:k){ trainingset <- subset(question, id %in% list[-i]) testset <- subset(question, id %in% c(i)) mymodel <- nnet(Sales1~ResidentA+ResidentB+ResidentD+DOW+Weather+Amt_Rainfall+Air_Quality+Avg_Temp+Humidity, data=trainingset, size=7, decay=0.1) temp <- as.data.frame(predict(mymodel, testset[,-5])) prediction <- rbind(prediction, temp) testsetCopy <- rbind(testsetCopy, as.data.frame(testset[,3])) progress.bar$step() } However, the result showed less than 1 that it seems something wrong. So...