Artificial Neural Networks


AN EXAMPLE NEURAL NETWORK

To illustrate what an artificial neural network is and how it works, let's walk through a simple example.

Our neural network will predict when people are sick from temperature and heart rate data. A simple example of what that neural network could look like is below.

\[ \Large{ S_{pred} = \frac{1}{1+e^{ - \left(\frac{\color{red} w_{\color{red} 7} }{1 + e^{-\left(T\cdot \color{red} w_{\color{red} 1}+ {HR}\cdot \color{red} w_{\color{red} 2} + \color{red} w_{\color{red} 3}\right)}} +\frac{\color{red} w_{\color{red} 8}}{1 + e^{-\left(T\cdot \color{red} w_{\color{red} 4}+ {HR}\cdot \color{red} w_{\color{red} 5} + \color{red} w_{\color{red} 6} \right)}} + \color{red} w_{\color{red} 9} \right) } } } \]

The point of showing this equation now is to highlight that there are a few parameters, w's, in the equation (in this example, we have 2 nodes in input layer, 2 nodes in hidden layer, 1 node in output layer).

TRAINING A NEURAL NETWORK TO MAKE BETTER PREDICTIONS

For this network to be useful, we need the predictions to be accurate. To do this, we need to find the best values for the w terms in the equation. The w terms are like settings, when we change the w's, we make our predictions better or worse. Unfortunately, when we are just starting out, we have no idea what the settings should be. Our best option is to start by guessing values for the ws. In this example, we will start by guessing that every w setting is equal to 1 (w1 = w2 = w3 = w4 = w5 = w6 = w7 = w8 = w9 = 1).

The network's first predictions

Next, we see if the w values work well. We start with the dataset below which includes heart rate, temperature and sickness state. To begin, recall that we guessed all w's = 1. We plug those w values into the equation. Then, we iterate over each row in the data set (which represents a patient), plugging temperature and heart rate into the equation. Finally, we run the calculation, and we get a prediciton of patient sickness (0 = not sick, 1 = sick).

[Click the gears to read in patient data and predict if the patient is sick or not.]