Icon

03 Training an LSTM Model - Solution

03 Training an LSTM Model - Exercise (Solution)

This workflow shows a solution to a hands-on exercise in the L4-DL Introduction to Deep Learning self-paced course

Task 1: Preprocess the data1. Convert the pickup_timestamp column into Date&Time2. Sort the data by time in ascending order3. Create 24 columns for the 24 past hours' trip counts4. Create a collection column of these past values5. Partition the data into training (until November 31, 2017) and test sets (December 2017) Task 2: Build and train an LSTM network1. Create an input layer with a varying sequence length and 24 features2. Create an LSTM layer with ReLU activation function and Sigmoid recurrent activation function3. Create a dense layer with ReLU activation function4. Train the LSTM network using mean squared error as the loss function Task 3: Execute and evaluate the LSTM network1. Execute the network on the test data2. Convert the output column to integer3. Evaluate the predictions with a line plot and with scoring metrics readnyc-taxi-data.csv24 past hoursshape: ?, 24ReLUSigmoidReLUMSEto intuntil Dec 2017only Dec 2017 CSV Reader Lag Column Create CollectionColumn Keras Input Layer Keras LSTM Layer Keras Dense Layer Keras NetworkLearner Keras NetworkExecutor Math Formula Line Plot (Plotly) Numeric Scorer Sorter String to Date&Time Date&Time-basedRow Filter ReferenceRow Filter Task 1: Preprocess the data1. Convert the pickup_timestamp column into Date&Time2. Sort the data by time in ascending order3. Create 24 columns for the 24 past hours' trip counts4. Create a collection column of these past values5. Partition the data into training (until November 31, 2017) and test sets (December 2017) Task 2: Build and train an LSTM network1. Create an input layer with a varying sequence length and 24 features2. Create an LSTM layer with ReLU activation function and Sigmoid recurrent activation function3. Create a dense layer with ReLU activation function4. Train the LSTM network using mean squared error as the loss function Task 3: Execute and evaluate the LSTM network1. Execute the network on the test data2. Convert the output column to integer3. Evaluate the predictions with a line plot and with scoring metrics readnyc-taxi-data.csv24 past hoursshape: ?, 24ReLUSigmoidReLUMSEto intuntil Dec 2017only Dec 2017 CSV Reader Lag Column Create CollectionColumn Keras Input Layer Keras LSTM Layer Keras Dense Layer Keras NetworkLearner Keras NetworkExecutor Math Formula Line Plot (Plotly) Numeric Scorer Sorter String to Date&Time Date&Time-basedRow Filter ReferenceRow Filter

Nodes

Extensions

Links