Stock Market Trend Prediction Using Machine Learning

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Content

1- Introduction
2- Why we need stock market prediction model ?
3- Steps to build this project
4- Results and conclusion

5- Literature Review
6- Reference
Introduction
● Stock market prediction is the act of trying to determine the future value of a company stock or
other financial instrument traded on a financial exchange.

● It is a machine learning model for stock market prediction using LSTM .

● The stock market prediction task is interesting as well as divides researchers and academics into groups
those who believe that we can devise mechanisms to predict the market and those who believe that the
market is efficient and whenever new information comes up the market absorbs it by correcting itself, thus
there is no space for prediction.

Stock market prediction is the act of trying to determine the future value of a company stock or other financial instrument traded on a financial e
Why we need stock market prediction model ?
● The objective is to help traders at all levels to analyze stock market without much
experience in the stock market.

● The aim is to predict whether the future close price value of a stock will rise or fall .

● The recent trend in stock market prediction technologies is the use of machine
learning which makes predictions based on the values of current stock market indices
by training on their previous values.
Steps to build this project

1) We collected the GAIL Company stock data.


2) We splitted the data into training set and testing set then preprocessed it.
3) We created an LSTM model.
4) We predicted the test data and plotted the output.
5) We predicted the future 30 days and plot the output and compared it
with actual stock opening price.
1-DATA COLLECTION

● We collected the data of GAIL company stocks opening price starting from
March’17 to March’22.
● Used yahoo finance for the current opening stock prices of the company.
● yfinance is a python library which is used to collect market data on stocks, bonds,
currencies, cryptocurrencie.
● The length of Dataset is 1236.
Collected Dataset

--------> Head

Tail <------------
Price

Plot for Opening Price vs Date


● The Blue line shows indicates the actual opening prices of the stock of 5
years .
2-DATA PREPROCESSING
1) LSTM is very sensitive to the scale of data.
2) Hence we Scaled the data using Min-Max Scalar .
3) We have splitted the data into two parts i.e Training part and testing part.
4) As LSTM is a time series model we have splitted 70% data into Training part and
remaining 30 % into Testing part.
5) Dataset division volume
● Length of training dataset – 865
● Length of testing dataset – 371
3- LSTM Model
● Long Short-Term Memory (LSTM) networks are a type of recurrent neural
network capable of learning order dependence in sequence prediction
problems.
● Nature of dataset - Sequential.
● Keras Libraries used - Dense, Sequential, LSTM.
Result and Conclusion
Opening prices

Opening prices
Days Days

● Successfully trained and tested GAIL stock prices.


● RMSE values are 140.99 and 235.71 for training and testing data respectively which is very promising.
We will now predict opening prices for the next 30 days.

● For that we have to collect last 100 days data from test dataset to predicting for next 30 days.
● We will create a list of 100 days data.
● To predict each next day opening price, we will take the past 100 days of data to predict the 101th day
and past 101 to know 102nd day’s opening price and so on.

● The orange line


Price

denotes the
predicted value
of next 30 days of
opening stock
price
Days
Price

Days
● This is the actual plot till 2nd Apri’22
● The predicted is very much close to the actual
price.
Literature Review
1- Stock Market prediction using LSTM by Mallikarjuna Shastry , Pramod-

Author implemented the proposed LSTM model which predicts the future price of
TATAMOTORS

The proposed algorithm is able to predict the share price very precisely,

For achieving further accuracy we have to include the sentiment analysis from social media
to understand what the market thinks about the price variation for a particular share.

Conclusion -: Finally author concluded that the prediction could be more reliable if the
model trains a greater number of data set.
2- Stock market Prediction using LSTM Recurrent neural network by Adil Moghar,
Mhamed Hamiche

The author build a model using recurrent neural network RNN and especially Long Short
Term memory to predict future stock market values of Google and Nike.

They used 80 % of data for training and the other 20 % of the data for testing.

The result of testing model has shown different results, the number of epochs as well as the
length of data have significant impact on the result of testing.

Conclusion -: The testing results confirm that their model is capable of tracking the
evolution of opening price for both assets.
Reference
[1] Hiba Sadia, Aditya Sharma, Adarrsh Paul, SarmisthaPadhi, Saurav Sanyal- “Stock Market Prediction
Using Machine Learning Algorithms”, IJEAT, 2019.

[2] Raut Sushrut Deepak, Shinde Isha Uday, Dr. D. Malathi, “Machine Learning Approach In Stock Market
Prediction”, IJPAM 2017

[3] M. S. Hegde, G. Krishna and R. Srinath, "An Ensemble Stock Predictor and Recommender System," 2018
International Conference on Advances in Computing, Communications and Informatics (ICACCI), Bangalore,
2018, pp. 1981-1985.

[4] M. Roondiwala, H. Patel and S. Varma, "Predicting stock prices using LSTM," International Journal of
Science and Research (IJSR), vol. 6, no. 4, pp. 1754-1756, 2017.
3 - Stock market prediction using Long Short Term Memory (LSTM) by Raghav Nandakumar,
Uttamraj, Vishal, YV Lokeshwari

Author compared the proposed stock market prediction system which uses an LSTM model with a
simple artificial neural network (ANN).

Model on five different stocks of varying sizes of data.

The result of comparison between LSTM and ANN shows that LSTM has a better prediction
accuracy than ANN.

Conclusion : They found that both models give better accuracy when the size of the dataset
increases. With more data, more patterns can be fleshed out by the model.

You might also like