Using a multilayer neural network
We will now apply our knowledge of different layers to real data by using a multilayer neural network on the low birth weight dataset.
Getting ready
Now that we know how to create neural networks and work with layers, we will apply this methodology with the aim of predicting birth weights in the low birth weight dataset. We'll create a neural network with three hidden layers. The low birth weight dataset includes the actual birth weights and an indicator variable for whether the given birth weight is above or below 2,500 grams. In this example, we'll make the target the actual birth weight (regression) and then see what the accuracy is on the classification at the end. At the end, our model should be able to identify whether the birth weight will be <2,500 grams.
How to do it...
We proceed with the recipe as follows:
- We will start by loading the libraries as follows:
import tensorflow as tf import matplotlib...