Skip to content

amoghadishesha/LSTM-Stock-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LSTM-Stock-prediction

Prediction of Apple stock 2 days in advance using LSTM-RNN OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network

Dataset: The dataset is taken from yahoo finace's website in CSV format. The dataset consists of Open, High, Low and Closing Prices of Apple Inc. stocks from 3rd january 2011 to 13th August 2017 - total 1664 rows. Price Indicator: Stock traders mainly use three indicators for prediction: OHLC average (average of Open, High, Low and Closing Prices), HLC average (average of High, Low and Closing Prices) and Closing price, In this project, OHLC average has been used. Data Pre-processing: After converting the dataset into OHLC average, it becomes one column data. This has been converted into two column time series data, 1st column consisting stock price of time t, and second column of time t+1. All values have been normalized between 0 and 1. Model: Two sequential LSTM layers have been stacked together and one dense layer is used to build the RNN model using Keras deep learning library. Since this is a regression task, 'linear' activation has been used in final layer. Training: 75% data is used for training. Adagrad (adaptive gradient algorithm) optimizer is used for faster convergence. Test: Test accuracy metric is root mean square error (RMSE). Observation and Conclusion: Stock price of last day of dataset was 158.8745 and using this model and price of next two days are predicted as 160.3230 and 160.9240 - which were 159.2075 and 159.8325 on 14th and 15th August 2017 according to Yahoo Finance.

About

Prediction of Apple stock 2 days in advance using LSTM-RNN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages