Stock Price Prediction using LSTM

Segun sodimu

Segun sodimu

Ogun State

1 0
  • 0 Collaborators

Stock price prediction is a model built to predict stock prices from a given time series datasets containing open and close market for a stock over a given pricr ...learn more

Project status: Published/In Market

Artificial Intelligence

Intel Technologies
Intel Integrated Graphics

Code Samples [1]

Overview / Usage

Recurrent neural networks (RNN) have proved one of the most powerful models for processing sequential data. Long Short-Term memory is one of the most successful RNNs architectures. LSTM introduces the memory cell, a unit of computation that replaces traditional artificial neurons in the hidden layer of the network. With these memory cells, networks are able to effectively associate memories and input remote in time, hence suit to grasp the structure of data dynamically over time with high prediction capacity.

This model is designed to predict stock prices of any related time series data.

Methodology / Approach

Stage 1: Raw Data: In this stage, the historical stock data is collected and this historical data is used for the prediction of future stock prices.

Stage 2: Data Preprocessing: The pre-processing stage involves :

  • Data discretization: Part of data reduction but with particular importance, especially for numerical data.
  • Data transformation: Normalization.
  • Data cleaning: Fill in missing values.
  • Data integration: Integration of data files. After the dataset is transformed into a clean dataset, the dataset is divided into training and testing sets so as to evaluate.

Stage 3: Feature Extraction: In this layer, only the features which are to be fed to the neural network are chosen. We will choose the feature from open & close.

Stage 4: Training Neural Network: In this stage, the data is fed to the neural network and trained for prediction assigning random biases and weights. Our LSTM model is composed of a sequential input layer followed by 1 LSTM layers and then finally a dense output layer with a linear activation function.

Optimizer

The type of optimizer used can greatly affect how fast the algorithm converges to the minimum value. Also, it is important that there is some notion of randomness to avoid getting stuck in a local minimum and not reach the global minimum. There are a few great algorithms, but I have chosen to use RMSprop with a loss function of mean_squared_error.

Technologies Used

Python

Numpy

Pandas

Keras

Repository

https://github.com/princesegzy01/lstm-google-stock-price-prediction

Comments (0)