In neural networks determining the number of hidden layers and the neurons is more like a trial and error process. It's time-consuming and tedious. There are some empirical rules regarding these. However, nothing works perfectly. So, is there any package in R which can calculate the number of hidden layers and neurons based on the data?