Neural Networks in R?



I am currently trying to make a project in neural networks using R for generating numerical predictions.
The data set contains 4 numerical predictor variables and 1 numerical response variable.
I know about the theoretical aspects of ANN. I am aware of the packages nnet, neuralnet, learNN.

Can anyone please suggest resources or write an article about how to implement Neural Networks in R.

I need help specifically for:

  1. Which functions and packages to use and how to use them?
  2. How to interpret the output of the functions used?
  3. How to tweak the model by adjusting various parameters like weights or size or delay etc. to get the best accurate model?
  4. Visualizing the model.
  5. Evaluation and checking the accuracy.
  6. Any other suggestions…


Hi @chaatak,
For Q3. (interpret output) and Q4. (model eval) the steps are similar to any machine algorithm. You check your algorithm on an evaluation metric. For a classification problem, you can use multiclass accuracy or multiclass log loss. For a regression problem you can use mean absolute error. This article discusses some metrics used in real life use cases.

For Q2. (tweaking model) here is a resource for a deeper understanding of how to tune parameters of neural networks. What you can do is do search from a bigger range to a smaller range. For example, to arrive at an approximately correct learning rate, decrease your learning rate with steps of 0.3 (1, 0.3, 0.1, 0.03…) and check you accuracy with time. In practice remember this diagram

As for implementation of NN in R, maybe someone with R background could comment on it.


Thanks @jalFaizy, It was really quite helpful and informative.


Hi - Another popular and easy to use package is H2o Deep Learning. You can find a good users guide here