Python deep learning model with Keras Long Short-Term Memory (LSTM) to predict the future behavior of Petrobras stock prices.
The purpose of this project was to get started forecasting time series with LSTM models. Based on the historical daily prices of Petrobras stocks from 2012 to 2018, the model predicts the opening prices of 2019. I still have to create different versions and improve the results.
- 1. Overview
- 2. Quick Start
- 3. What is LSTM and how it works
- 4. Dataset
- 5. Approach
- 6. Dependencies
- 7. Results
- 8. Useful
In this project I use Keras Long Short-Term Memory (LSTM) Model to Predict Petrobras Stock Prices. LSTMs are very powerful in sequence prediction problems because they're able to store past information. This is important here because the previous price of a stock is crucial in predicting its future price. Stock market data is a great choice for this kind of study because it’s quite regular and widely available to everyone.
Checkout a static version of the notebook with Jupyter NBViewer from the comfort of your web browser.
Long Short-Term Memory (LSTM) networks are a type of recurrent neural network capable of learning order dependence in sequence prediction problems. LSTMs have feedback connections, which enables it to process entire sequences of data (e.g. time series). Rather than treating each point in the sequence independently, LSTMs retains useful information about previous data in the sequence to help with the processing of new data points. As a result, LSTMs are particularly good at processing sequences of data such as text, speech and general time-series.
For this project I used the Yahoo Finance for the historical daily prices of Petrobras stocks.
- Training dataset: historical daily prices of Petrobras stocks from 2012 to 2018
- Test dataset: historical daily prices of Petrobras stocks of 2019
- PART 1: Data Handling -> Importing Data with Pandas, Cleaning Data, Data description.
- PART 2: Data Analysis -> Supervised ML Technique: LSTM algorithm
- PART 3: Valuation of the Analysis -> Plotting results
- kd Nuggets - Using a Keras Long Short-Term Memory (LSTM) Model to Predict Stock Prices
- Towards Datas Cience - LSTM Networks | A Detailed Explanation
- PUC Goiais - Seleção de portfólio de ações por meio de otimização metaheurística híbrida com redes neurais LSTM
- Medium - Deep Learning and Portfolio Management
- Coursera - Investment Management with Python and Machine Learning Specialization