Preface |
|
xv | |
Acknowledgments |
|
xvii | |
About This Book |
|
xviii | |
About The Author |
|
xxii | |
About The Cover Illustration |
|
xxiii | |
|
1 Why Deep Learnings Structured Data? |
|
|
1 | (17) |
|
1.1 Overview of deep learning |
|
|
2 | (4) |
|
1.2 Benefits and drawbacks of deep learning |
|
|
6 | (3) |
|
1.3 Overview of the deep learning stack |
|
|
9 | (1) |
|
1.4 Structured vs. unstructured data |
|
|
10 | (2) |
|
1.5 Objections to deep learning with structured data |
|
|
12 | (2) |
|
1.6 Why investigate deep learning with a structured data problem? |
|
|
14 | (1) |
|
1.7 An overview of the code accompanying this book |
|
|
14 | (1) |
|
1.8 What you need to know |
|
|
15 | (1) |
|
|
16 | (2) |
|
2 Introduction To The Example Problem And Pandas Dataframes |
|
|
18 | (27) |
|
2.1 Development environment options for deep learning |
|
|
19 | (2) |
|
2.2 Code for exploring Pandas |
|
|
21 | (1) |
|
2.3 Pandas dataframes in Python |
|
|
22 | (2) |
|
2.4 Ingesting CSV files into Pandas dataframes |
|
|
24 | (1) |
|
2.5 Using Pandas to do what you would do with SQL |
|
|
25 | (3) |
|
2.6 The major example: Predicting streetcar delays |
|
|
28 | (2) |
|
2.7 Why is a real-world dataset critical for learning about deep learning? |
|
|
30 | (1) |
|
2.8 Format and scope of the input dataset |
|
|
31 | (2) |
|
2.9 The destination: An end-to-end solution |
|
|
33 | (2) |
|
2.10 More details on the code that makes up the solutions |
|
|
35 | (2) |
|
2.11 Development environments: Vanilla vs. deep-learning-enabled |
|
|
37 | (1) |
|
2.12 A deeper look at the objections to deep learning |
|
|
38 | (3) |
|
2.13 How deep learning has become more accessible |
|
|
41 | (1) |
|
2.14 A first taste of training a deep learning model |
|
|
42 | (2) |
|
|
44 | (1) |
|
3 Preparing The Data, Part 1: Exploring And Cleansing The Data |
|
|
45 | (22) |
|
3.1 Code for exploring and cleansing the data |
|
|
46 | (1) |
|
3.2 Using config files with Python |
|
|
46 | (2) |
|
3.3 Ingesting XLS files into a Pandas dataframe |
|
|
48 | (4) |
|
3.4 Using pickle to save your Pandas dataframe from one session to another |
|
|
52 | (2) |
|
|
54 | (4) |
|
3.6 Categorizing data into continuous, categorical, and text categories |
|
|
58 | (2) |
|
3.7 Cleaning up problems in the dataset: missing data, errors, and guesses |
|
|
60 | (5) |
|
3.8 Finding out how much data deep learning needs |
|
|
65 | (1) |
|
|
66 | (1) |
|
4 Preparing The Data, Part 2: Transforming The Data |
|
|
67 | (20) |
|
4.1 Code for preparing and transforming the data |
|
|
68 | (1) |
|
4.2 Dealing with incorrect values: Routes |
|
|
68 | (2) |
|
4.3 Why only one substitute for all bad values? |
|
|
70 | (1) |
|
4.4 Dealing with incorrect values: Vehicles |
|
|
71 | (1) |
|
4.5 Dealing with inconsistent values: Location |
|
|
72 | (2) |
|
4.6 Going the distance: Locations |
|
|
74 | (3) |
|
4.7 Fixing type mismatches |
|
|
77 | (1) |
|
4.8 Dealing with rows that still contain bad data |
|
|
78 | (1) |
|
4.9 Creating derived columns |
|
|
79 | (1) |
|
4.10 Preparing non-numeric data to train a deep learning model |
|
|
80 | (3) |
|
4.11 Overview of the end-to-end solution |
|
|
83 | (3) |
|
|
86 | (1) |
|
5 Preparing And Building The Model |
|
|
87 | (33) |
|
5.1 Data leakage and features that are fair game for training the model |
|
|
88 | (1) |
|
5.2 Domain expertise and minimal scoring tests to prevent data leakage |
|
|
89 | (1) |
|
5.3 Preventing data leakage in the streetcar delay prediction problem |
|
|
90 | (2) |
|
5.4 Code for exploring Keras and building the model |
|
|
92 | (1) |
|
5.5 Deriving the dataframe to use to train the model |
|
|
93 | (4) |
|
5.6 Transforming the dataframe into the format expected by the Keras model |
|
|
97 | (1) |
|
5.7 A brief history of Keras and TensorFlow |
|
|
98 | (1) |
|
5.8 Migrating from TensorFlow 1.x to TensorFlow 2 |
|
|
99 | (1) |
|
5.9 TensorFlow vs. PyTorch |
|
|
100 | (1) |
|
5.10 The structure of a deep learning model in Keras |
|
|
100 | (4) |
|
5.11 How the data structure defines the Keras model |
|
|
104 | (3) |
|
5.12 The power of embeddings |
|
|
107 | (2) |
|
5.13 Code to build a Keras model automatically based on the data structure |
|
|
109 | (2) |
|
5.14 Exploring your model |
|
|
111 | (6) |
|
|
117 | (2) |
|
|
119 | (1) |
|
6 Training The Model And Running Experiments |
|
|
120 | (30) |
|
6.1 Code for training the deep learning model |
|
|
121 | (1) |
|
6.2 Reviewing the process of training a deep learning model |
|
|
121 | (3) |
|
6.3 Reviewing the overall goal of the streetcar delay prediction model |
|
|
124 | (3) |
|
6.4 Selecting the train, validation, and test datasets |
|
|
127 | (1) |
|
|
127 | (3) |
|
6.6 Measuring the performance of your model |
|
|
130 | (3) |
|
6.7 Keras callbacks: Getting the best out of your training runs |
|
|
133 | (7) |
|
6.8 Getting identical results from multiple training runs |
|
|
140 | (1) |
|
|
141 | (2) |
|
6.10 Explicitly saving trained models |
|
|
143 | (1) |
|
6.11 Running a series of training experiments |
|
|
143 | (5) |
|
|
148 | (2) |
|
7 More Experiments With The Trained Model |
|
|
150 | (11) |
|
7.1 Code for more experiments with the model |
|
|
151 | (1) |
|
7.2 Validating whether removing bad values improves the model |
|
|
151 | (1) |
|
7.3 Validating whether embeddings for columns improve the performance of the model |
|
|
152 | (1) |
|
7.4 Comparing the deep learning model with XGBoost |
|
|
153 | (6) |
|
7.5 Possible next steps for improving the deep learning model |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
161 | (31) |
|
8.1 Overview of model deployment |
|
|
162 | (1) |
|
8.2 If deployment is so important, why is it so hard? |
|
|
163 | (1) |
|
8.3 Review of one-off scoring |
|
|
164 | (1) |
|
8.4 The user experience with web deployment |
|
|
165 | (1) |
|
8.5 Steps to deploy your model with web deployment |
|
|
165 | (4) |
|
8.6 Behind the scenes with web deployment |
|
|
169 | (3) |
|
8.7 The user experience with Facebook Messenger deployment |
|
|
172 | (2) |
|
8.8 Behind the scenes with Facebook Messenger deployment |
|
|
174 | (1) |
|
8.9 More background on Rasa |
|
|
175 | (2) |
|
8.10 Steps to deploy your model in Facebook Messenger with Rasa |
|
|
177 | (3) |
|
8.11 Introduction to pipelines |
|
|
180 | (3) |
|
8.12 Defining pipelines in the model training phase |
|
|
183 | (3) |
|
8.13 Applying pipelines in the scoring phase |
|
|
186 | (2) |
|
8.14 Maintaining a model after deployment |
|
|
188 | (2) |
|
|
190 | (2) |
|
|
192 | (31) |
|
9.1 Reviewing what we have covered so far |
|
|
193 | (1) |
|
9.2 What we could do next with the streetcar delay prediction project |
|
|
194 | (1) |
|
9.3 Adding location details to the streetcar delay prediction project |
|
|
194 | (4) |
|
9.4 Training our deep learning model with weather data |
|
|
198 | (5) |
|
9.5 Adding season or time of day to the streetcar delay prediction project |
|
|
203 | (1) |
|
9.6 Imputation: An alternative to removing records with bad values |
|
|
204 | (1) |
|
9.7 Making the web deployment of the streetcar delay prediction model generally available |
|
|
204 | (2) |
|
9.8 Adapting the streetcar delay prediction model to a new dataset |
|
|
206 | (3) |
|
9.9 Preparing the dataset and training the model |
|
|
209 | (2) |
|
9.10 Deploying the model with web deployment |
|
|
211 | (1) |
|
9.11 Deploying the model with Facebook Messenger |
|
|
212 | (3) |
|
9.12 Adapting the approach in this book to a different dataset |
|
|
215 | (4) |
|
9.13 Resources for additional learning |
|
|
219 | (1) |
|
|
220 | (3) |
Appendix Using Google Colaboratory |
|
223 | (10) |
Index |
|
233 | |