Skip to content

One method for predicting stock prices is using a long short-term memory neural network (LSTM) for times series forecasting.

Notifications You must be signed in to change notification settings

Prince2124/Stock-Market-Prediction-And-Forecasting-Using-LSTM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stock-Market-Prediction-And-Forecasting-Using-LSTM

One method for predicting stock prices is using a long short-term memory neural network (LSTM) for times series forecasting. We’ll use a combination of AI calculations to forecast this company’s future stock price with LSTM.

Execution Process

1. Loading the Data

The Appl data is from 2015-05-27 up to 22-05-2020. We take the close column for the stock prediction. We can use the same strategy.

data

Data_plot

2. Train and Test Split

The training size should be 65% of the total length of the data frame, the test size should be the difference between the length of the dataset and the training size.

3. Data Preprocessing

Now the timestep value will be 100. We split the data X, Y. In the 0th iteration the first 100 elements goes as your first record and the 101 elements will be put up in the X. The 100 elements will be put up in the Y.

4. LSTM has three gates:

The input gate: The input gate adds information to the cell state, The forget gate: It removes the information that is no longer required by the model, The output gate: Output Gate at LSTM selects the information to be shown as output.

model

5. Prediction

The values in train predict and test predict. I got,i am just plotting it:

A. Green indicates the Predicted Data

B. Blue indicates the Complete Data

C. Orange indicates the Train Data

Prediction

References

link to Google!

About

One method for predicting stock prices is using a long short-term memory neural network (LSTM) for times series forecasting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published