# R - Interpreting neural networks plot

I know there are similar question on stats.SE, but I didn't find one that fulfills my request; please, before mark the question as a duplicate, ping me in the comment.

I run a neural network based on neuralnet to forecast SP500 index time series and I want to understand how I can interpret the plot posted below:

Particularly, I'm interested to understand what is the interpretation of the hidden layer weight and the input weight; could someone explain me how to interpret that number, please?

Any hint will be appreciated.

• Here is an interesting article that relates to your question. labs.eeb.utoronto.ca/jackson/ecol.%20modelling%20ANN.pdf Jul 10, 2015 at 4:06
• Thanks for the comment, @MrMeritology! I found that really useful! Jul 10, 2015 at 11:25
• While I'm sure you you'll be able to understand this (pretty simple) neural network, if interpretability is a relatively large concern then you probably shouldn't be using a neural network in the first place. Is there a specific reason you selected one over other algorithms? Jul 11, 2015 at 0:06
• Yes, @David! I would like to learn using this kind of model. I never used them in my job and I'm studying that just for fun. Do you have any idea about interpreting the plot? Jul 11, 2015 at 9:27
• i need help to interpret an ANN analysis Anybody that can help? Oct 31, 2018 at 19:29

## 1 Answer

As David states in the comments if you want to interpret a model you likely want to explore something besides neural nets. That said it you want to intuitively understand the network plot it is best to think of it with respect to images (something neural networks are very good at).

1. The left-most nodes (i.e. input nodes) are your raw data variables.
2. The arrows in black (and associated numbers) are the weights which you can think of as how much that variable contributes to the next node. The blue lines are the bias weights. You can find the purpose of these weights in the excellent answer here.
3. The middle nodes (i.e. anything between the input and output nodes) are your hidden nodes. This is where the image analogy helps. Each of these nodes constitute a component that the network is learning to recognize. For example a nose, mouth, or eye. This is not easily determined and is far more abstract when you are dealing with non-image data.
4. The far-right (output node(s)) node is the final output of your neural network.

Note that this all is omitting the activation function that would be applied at each layer of the network as well.

• Great answer @cdeterman! many things seem to be more clear now. last thing... according to you, how can I backtest the model ability to forecast the output basing on the input value. Let me explain better; in the case I use a simple logistic model, I can use the $\beta$ vector and the independent variables to compute a forecast of the dependent variable. In the neural network model, how can I do this? Jan 27, 2016 at 18:36
• @Quantopic I think you are referring to the compute function in the neuralnet package. The source isn't terribly complex if you wish to do it by hand. Essentially you are applying the weights and activation function at each layer to the final result. Jan 27, 2016 at 18:48