chapter five
5 Preparing and Building the Model
This chapter covers
- Revisiting the dataset and determining which features are fair game to train the model with
- Refactoring the dataset to take into account the periods when the streetcar network experienced no delays on a given route in a given direction
- Transforming the dataset into the format expected by the Keras model
- Code to build a Keras model automatically based on the structure of the data
- Examining the structure of the model
- Model parameters, including output layer activation function and optimization function, and learning rate
This chapter begins with a quick re-examination of the dataset to consider which columns can legitimately be used to train the model. Then we’ll go over the transformations required to get the data from the format where we have been manipulating it (as Pandas dataframes) to the format expected by the deep learning model. We will then go over the code for the model itself and see how the model is built up layer by layer based on the category of the input columns. We wrap up by reviewing methods you can use to examine the structure of the model and the parameters you can use to adjust how the model is trained.