Question: In the Python file, you will be creating a neural network to predict the price of a stock. Part of the program is already implemented,

In the Python file, you will be creating a neural network to predict the price of a stock. Part of the program is already implemented, your goal is to set up the model, train the model on the training data set, then finally predict the values from the testing data set.
These are the following details you need to implement:
You should create a Sequential model with 5 layers.
Your model should use 2 LSTM layers, and after each use a Dropout layer with a rate of 0.2. The first LSTM layer should have input_shape as a parameter along with units set to 4. The final layer should be a Dense layer with units set to 1.
Once the model is set up, you should compile it with a mean_squared_error loss and the optimizer set to adam
When you fit the training dataset, make sure to set the following values: epochs-5, batch size-16, verbose=0
Finally, you should run the predict function on the x_test dataset and print the last column of the array along with the model
summary.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!