Multivariate Time Series Prediction with LSTM and Multiple features (Predict Google Stock Price)

Build a Artificial Neural Network (ANN) with Long-Short Term Memory (LSTM) to predict value which can be impacted by multiple different features.

In this video I demonstrate how to use LSTM to predict Google Stock price (you can use any other case) by taking into consideration multiple predictors (features). Let’s say, the final stock price can be predicted by finding importance of such features as historical low price, high price, volume, adj. price, etc.

Link to github notebook:

The video has 3 parts:
– Part 01. Data pre-processing (4:11)
| Step 01: Read data.
| Step 02: Data pre-processing (shaping and transformations).

– Part 02. Create a LSTM model and train it. (10:39)
| Step 03: Building-up the LSTM based Neural Network.
| Step 04: Start training.

– Part 03. Make future predictions. (13:50)
| Step 05: Make predictions for future date.
| Step 06: Visualize the predictions.

In this tutorial I used Tensorflow 1.15.0 and Keras 2.3.1

Download data from: (check 1:59 in video).

This is real life Python code example for demonstration purposes, so the model is not very accuracy and of course could be improved or tuned.

My goal of this Python tutorial is to demonstrate how to perform LSTM predictions with multiple features (complex dataset).

Hoping it will help to undersant the way it could be implemented in real Data Science or Data Analysis projects. TIme Series forecasting with LSTM is the good choice if you want to manipulate with multiple different data features and see which ones has impact to predictions and which ones do not.

If you are interested how to run Tensorboard on this LSTM Keras model, check this tutorial:

Sorry for video quality. There were some unexpected issues with resolution.
Video Rating: / 5

19 Antworten auf „Multivariate Time Series Prediction with LSTM and Multiple features (Predict Google Stock Price)“

  1. Can you make an example using returns? I think it would be interesting if you could model something that tries to guess correctly the side of the future price (if it's going up or down, rather than how much)

  2. hello, can we do multivariate LSTM prediction without using the target feature as input feature? that means here remove the column of 'open' as input variable, only using 'high, low, close, adj close' as the 4 features to predict 'open' with LSTM?

  3. At 10:16, shouldn't it be y_train.append(training_set_scaled[i : i+n_future, 0]) ? You say that you want to use window of 90 days to predict values for 60 days but that part of code shows training on 90 days to predict on one single day that happens 60 days in the future.

  4. Here future predictions are exact same as training predictions. that means, it takes last train predicted data and plot them as future predictions. but not actual predictions

  5. Thank you for your code and video Dr. Vytautas! I am just confused about the train_x, do you only include the first 4 features for training instead of all the 6 features?

  6. Качество видео плохое. Даже на full HD. И масштаб кода нужно больше. 10% рабочей области на мыльном экране – это мало.

  7. Hi Dr., I am currently working with similar project and wanted to implement multivariate LSTM on predicting CPU resource utilization, memory usage, running processes, etc.
    Can you make a multistep output in predicting both Open, Close, High and Volume prediction?

    Great work!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.