Time Series Forecasting of Amazon Stock Prices using
Neural Networks
By
Under the Esteemed Guidance of
Dr. S. Shiva Kumar
Head of Department
Department of CSE -AIML
Malla Reddy Engineering College( Autonomous)
Maisammaguda, Dhulapally(Po), Via Kompally,
Secunderabad-500100
1
ALTHAF JAFFERY MD 20J41A6602
E HARI PRASAD 21J45A6601
K ANIL KUMAR 21J45A6603
V VAMSI 21J45A6606
mazon Stocks Prediction
Using Neural Networks
2
3
 Introduction
 Objectives
 Existing System
 Proposed System
 Methodology
 References
 Conclusion
4
why predicting stocks…?
The successful prediction of a
stock's future price could yield
significant profit. The efficient-
market hypothesis suggests that
stock prices reflect all currently
available information and any price
changes that are not based on newly
revealed information thus are
inherently unpredictable
5
Objective
• Stock market prediction is the act
of trying to determine the future value of
a company stock or other financial
instrument traded on an exchange. The
successful prediction of a stock's future
price could yield significant profit.
• This project main goal is to study and
apply deep learning techniques to the
stock market in order to predict stock
behavior and thus act on those
predictions to avoid investment risk and
generate profit.
6
• The stock market prediction problem has drawn a lot of interest from
academics and industry professionals since it is crucial yet difficult.
• Due to the complexity and ambiguity of the natural language used in the
news, conventional machine learning models frequently fail to understand
the substance of financial news.
• An RNN-based ensemble model for financial market prediction using news
releases was reported in this study.
• The sliding window approach and sentiment analysis were used to extract
the most representative characteristics from historical data and financial
news.
• Compared to conventional pre-processing techniques (such bag-of-words
and TF-IDF), which extract tens of thousands of features, this significantly
decreased the number of dimensions.
Existing System:
7
Data gathered from a variety of sources make up the
proposed project. The data will be examined for accuracy.
The cleansed data will be created for testing and training
purposes. The machine learning approach is used to generate
the model, The ideal one serves as a template. The new stock
price is predicted using the data model.
Proposed System:
The LSTM model
Long short-term memory (LSTM) is an artificial recurrent
neural network (RNN) architecture used in the field of deep
learning. Unlike standard feedforward neural networks,
LSTM has feedback connections. It can not only process single
data points , but also entire sequences of data.
LSTM models are able to store information over a period of
time. This characteristic is extremely useful when we deal
with Time-Series or Sequential Data.
8
Methodology
The LSTM algorithm has been widely used in sequence
prediction research and has proven to be quite
successful.
Data Collection and Preprocessing:
Acquiring historical Amazon stock price data in CSV
format. Uploaded the dataset into Jupyter Notebook
environment. Uses Pandas to load and preprocess the
data. This includes handling missing values, outliers,
and data normalization.
Data Exploration:
Conducts exploratory data analysis (EDA) to gain
insights into the dataset. Visualize key statistics and
trends in the Amazon stock price data using
Matplotlib.pyplot.
9
Neural Network Architecture:
The LSTM-based neural network architecture
using the Torch and Torch.nn libraries. Specify the
number of LSTM layers, the number of neurons in
each layer, and the output layer for prediction.
Data Splitting:
Splits the dataset into training, validation, and test
sets.
Typically, use a larger portion for training (e.g., 70-
80%) and the remaining for validation and testing.
Model Training:
Trains the LSTM model using the training data.
Utilize the Torch library for model training.
Experiment with different hyperparameters (e.g.,
learning rate, batch size, epochs) to optimize the
model's performance.
10
Model Testing:
Evaluates the trained LSTM model on the test
dataset, which the model hasn't seen during
training.
Calculates and displays performance metrics such
as MAE, MSE, RMSE on the test set.
Prediction and Visualization:
Makes predictions on future Amazon stock prices
using the trained LSTM model.
Plots the predicted stock price trends along with
actual data using Matplotlib.pyplot.
11
Future Scope
Real-Time Data Integration: Modify the project to fetch real-time stock
price data from reliable sources and continuously update the model to
make daily predictions.
Risk Assessment: Integrate risk assessment metrics and strategies into
the present project. Implementing tools to calculate Value at Risk (VaR) or
Conditional Value at Risk (CVaR) to measure the potential downside risk.
Automated Trading: Understanding of financial markets and risk
management, the model can be trained and explored to automating
trading strategies based on the model's predictions. However, this should
be approached cautiously and ideally with the help of a financial advisor.
12
• Our project successfully demonstrated the application of LSTM
neural networks for Amazon stock price prediction.
• We leveraged Python libraries and data preprocessing
techniques to develop a model capable of generating forecasts.
• While predictive modeling can be a valuable tool for traders and
investors, it's important to use such models in conjunction with
other investment strategies and risk management techniques,
acknowledging that financial markets are inherently uncertain
and subject to various influences.
Conclusion:
13
[1] Raymond Chiong , Zongwen Fan, Zhongyi Hu, and Sandeep Dhakal “A Novel
Ensemble Learning Approach for Stock Market Prediction Based on Sentiment Analysis
and the Sliding Window Method”,2022.
[2] T. Fischer and C. Krauss, “Deep learning with long short-term memory 600
networks for financial market predictions,” Eur. J. Oper. Res., vol. 270, 601 no. 2, pp.
654–669, Dec. 2017. 602
[3] X. Wu, Q. Ye, H. Hong, and Y. Li, “Stock selection model based on 603 machine
learning with wisdom of experts and crowds,” IEEE Intell. 604 Syst., vol. 35, no. 2, pp.
54–64, Mar. 2020. 605 [4] M. Jiang, L. Jia, Z. Chen, and W. Chen, “The two-stage machine
606 learning ensemble models for stock price prediction by combining 607 mode
decomposition, extreme learning machine and improved har- 608 mony search
algorithm,” Ann. Oper. Res., vol. 309, pp. 553–585, 609 Jun. 2020. 610
REFERENCES
14
Thank You All

Batch_12_TSA_using_LSTM machine learning project

  • 1.
    Time Series Forecastingof Amazon Stock Prices using Neural Networks By Under the Esteemed Guidance of Dr. S. Shiva Kumar Head of Department Department of CSE -AIML Malla Reddy Engineering College( Autonomous) Maisammaguda, Dhulapally(Po), Via Kompally, Secunderabad-500100 1 ALTHAF JAFFERY MD 20J41A6602 E HARI PRASAD 21J45A6601 K ANIL KUMAR 21J45A6603 V VAMSI 21J45A6606
  • 2.
  • 3.
    3  Introduction  Objectives Existing System  Proposed System  Methodology  References  Conclusion
  • 4.
    4 why predicting stocks…? Thesuccessful prediction of a stock's future price could yield significant profit. The efficient- market hypothesis suggests that stock prices reflect all currently available information and any price changes that are not based on newly revealed information thus are inherently unpredictable
  • 5.
    5 Objective • Stock marketprediction is the act of trying to determine the future value of a company stock or other financial instrument traded on an exchange. The successful prediction of a stock's future price could yield significant profit. • This project main goal is to study and apply deep learning techniques to the stock market in order to predict stock behavior and thus act on those predictions to avoid investment risk and generate profit.
  • 6.
    6 • The stockmarket prediction problem has drawn a lot of interest from academics and industry professionals since it is crucial yet difficult. • Due to the complexity and ambiguity of the natural language used in the news, conventional machine learning models frequently fail to understand the substance of financial news. • An RNN-based ensemble model for financial market prediction using news releases was reported in this study. • The sliding window approach and sentiment analysis were used to extract the most representative characteristics from historical data and financial news. • Compared to conventional pre-processing techniques (such bag-of-words and TF-IDF), which extract tens of thousands of features, this significantly decreased the number of dimensions. Existing System:
  • 7.
    7 Data gathered froma variety of sources make up the proposed project. The data will be examined for accuracy. The cleansed data will be created for testing and training purposes. The machine learning approach is used to generate the model, The ideal one serves as a template. The new stock price is predicted using the data model. Proposed System: The LSTM model Long short-term memory (LSTM) is an artificial recurrent neural network (RNN) architecture used in the field of deep learning. Unlike standard feedforward neural networks, LSTM has feedback connections. It can not only process single data points , but also entire sequences of data. LSTM models are able to store information over a period of time. This characteristic is extremely useful when we deal with Time-Series or Sequential Data.
  • 8.
    8 Methodology The LSTM algorithmhas been widely used in sequence prediction research and has proven to be quite successful. Data Collection and Preprocessing: Acquiring historical Amazon stock price data in CSV format. Uploaded the dataset into Jupyter Notebook environment. Uses Pandas to load and preprocess the data. This includes handling missing values, outliers, and data normalization. Data Exploration: Conducts exploratory data analysis (EDA) to gain insights into the dataset. Visualize key statistics and trends in the Amazon stock price data using Matplotlib.pyplot.
  • 9.
    9 Neural Network Architecture: TheLSTM-based neural network architecture using the Torch and Torch.nn libraries. Specify the number of LSTM layers, the number of neurons in each layer, and the output layer for prediction. Data Splitting: Splits the dataset into training, validation, and test sets. Typically, use a larger portion for training (e.g., 70- 80%) and the remaining for validation and testing. Model Training: Trains the LSTM model using the training data. Utilize the Torch library for model training. Experiment with different hyperparameters (e.g., learning rate, batch size, epochs) to optimize the model's performance.
  • 10.
    10 Model Testing: Evaluates thetrained LSTM model on the test dataset, which the model hasn't seen during training. Calculates and displays performance metrics such as MAE, MSE, RMSE on the test set. Prediction and Visualization: Makes predictions on future Amazon stock prices using the trained LSTM model. Plots the predicted stock price trends along with actual data using Matplotlib.pyplot.
  • 11.
    11 Future Scope Real-Time DataIntegration: Modify the project to fetch real-time stock price data from reliable sources and continuously update the model to make daily predictions. Risk Assessment: Integrate risk assessment metrics and strategies into the present project. Implementing tools to calculate Value at Risk (VaR) or Conditional Value at Risk (CVaR) to measure the potential downside risk. Automated Trading: Understanding of financial markets and risk management, the model can be trained and explored to automating trading strategies based on the model's predictions. However, this should be approached cautiously and ideally with the help of a financial advisor.
  • 12.
    12 • Our projectsuccessfully demonstrated the application of LSTM neural networks for Amazon stock price prediction. • We leveraged Python libraries and data preprocessing techniques to develop a model capable of generating forecasts. • While predictive modeling can be a valuable tool for traders and investors, it's important to use such models in conjunction with other investment strategies and risk management techniques, acknowledging that financial markets are inherently uncertain and subject to various influences. Conclusion:
  • 13.
    13 [1] Raymond Chiong, Zongwen Fan, Zhongyi Hu, and Sandeep Dhakal “A Novel Ensemble Learning Approach for Stock Market Prediction Based on Sentiment Analysis and the Sliding Window Method”,2022. [2] T. Fischer and C. Krauss, “Deep learning with long short-term memory 600 networks for financial market predictions,” Eur. J. Oper. Res., vol. 270, 601 no. 2, pp. 654–669, Dec. 2017. 602 [3] X. Wu, Q. Ye, H. Hong, and Y. Li, “Stock selection model based on 603 machine learning with wisdom of experts and crowds,” IEEE Intell. 604 Syst., vol. 35, no. 2, pp. 54–64, Mar. 2020. 605 [4] M. Jiang, L. Jia, Z. Chen, and W. Chen, “The two-stage machine 606 learning ensemble models for stock price prediction by combining 607 mode decomposition, extreme learning machine and improved har- 608 mony search algorithm,” Ann. Oper. Res., vol. 309, pp. 553–585, 609 Jun. 2020. 610 REFERENCES
  • 14.