To perform a neural network regression analysis, we will use the Keras Sequential model. As we mentioned inChapter 1, Getting Started with Keras, to create a Keras Sequential model, we must follow these steps:
-
Import the Sequential class from keras.models.
-
Stack the layers using .add() method.
-
Configure the learning process using .compile() method.
-
Train the model on the train dataset using .fit() method.
We have omitted the import data step because our data is already available in the Python environment. We will use the following steps to perform the analysis:
First, we have to load the libraries needed to run the analysis:
from keras.models import Sequentialfrom keras.layers import Densefrom keras import ...