Q:

Neural Network By Rstudio

I use R to run neural network model, but The Rsquared is too low. I have tried different learning rate, threshold and neurons but still the R-square is below 50%. Is there anything I can do to improve this condition?
My code:
formula.bpn<-Y~X1+X2+X3+X4+X5+X6

bpn<-neuralnet(formula = formula.bpn, data = data, hidden = c(3), learningrate = 0.1, 
               threshold = 0.5, stepmax = 5e5)
smp.size<-floor(0.8*nrow(data))
set.seed(131)
train.ind<-sample(seq_len(nrow(data)),smp.size)
train<-data[train.ind,]
test<-data[-train.ind,]
model <- train(form=formula.bpn,data=train, 
               method="neuralnet",
               tuneGrid = expand.grid(.layer1=c(1:20), .layer2=c(0), .layer3=c(0)),
               learningrate = 0.5,threshold = 0.5,stepmax = 5e5)

A:

The RMSE doesn't seem to improve for larger networks and beyond a layer size of 4 your $R^2$ doesn't improve much, that means that layer size isn't what is limiting performance. 
Neural networks are hard to train, any of your hyper-parameters could be what is limiting performance. We can suggest what might be the problem but really the only way to know is if you test out different values of hyperparameters. You don't need to do a full gridsearch, changing one hyperparameter at a time can show which was most incorrect.

Your threshold performance looks very high, maybe training is stopping too early.
You have two learning rates in your code, 0.5 isn't absurdly high but it seems higher than normal, perhaps you should try a different rate. 
Stepmax is a normal size, I doubt the issue lies with that.

