CSE182PR
CSE182PR
Bachelor of Technology
in
Computer Science and Engineering
by
Ashutosh Sarkar(201500169)
Navneet Singh (201500433)
Himanshu Gupta(201500294)
Amit Kumar Yadav(201500081)
GLA University
Mathura- 281406, INDIA
April, 2024
Department of Computer Engineering and Applications
GLA University, 17 km Stone, NH#2, Mathura-Delhi Road,
P.O. Chaumuhan, Mathura-281406 (U.P.)
Declaration
I hereby declare that the work which is being presented in the B.Tech. Project
“Stock price prediction using machine learning”, in partial fulfillment of the
requirements for the award of the Bachelor of Technology in Computer
Science and Engineering and submitted to the Department of Computer
Engineering and Applications of GLA University, Mathura, is an authentic
record of my own work carried under the supervision of Mr. Vikash Sawan ,
Assistant Professor.
The contents of this project report, in full or in parts, have not been
submitted to any other Institute or University for the award of any degree.
Sign Sign
Ashutosh Sarkar Navneet Singh
201500169 201500433
Sign Sign
Himanshu Gupta Amit Kumar Yadav
201500294 201500081
Department of Computer Engineering and Applications
GLA University, 17 km Stone, NH#2, Mathura-Delhi Road,
P.O. Chaumuhan, Mathura-281406 (U.P.)
Certificate
This is to certify that the above statements made by the candidate are
correct to the best of my/our knowledge and belief.
Supervisor
(Name of Supervisor)
Designation of Supervisor
Dept. of Computer Engg, & App.
Date:
ACKNOWLEDGEMENT
I take this opportunity to express my sincere gratitude and respect to GLA University,
Mathura for providing me a platform to pursue my studies and carry out my final
year project. I have a great pleasure in expressing my deep sense of gratitude to Mr.
Vikash Sawan, Assistant Professor, GLA University ,Mathura for his constant
encouragement.
I consider it a privilege and honor to the express my sincere gratitude the to my guide
and Engineering , for the valuable guidance throughout the tenure of this review.
I also extend my thanks to all the faculty of Computer Science and Engineering who
Finally, I would like to thank my parents and friends for all their moral support they
Sign Sign
Ashutosh Sarkar Navneet Singh
201500169 201500433
Sign Sign
Himanshu Gupta Amit Kumar Yadav
201500294 201500081
ABSTRACT
CHAPTER 1 Introduction 1
1.1 introduction 1
1.2 overview 2
1.3 motivation 2
1.4 objective 3
1.5 Issue and challenges 4
1.6 Organization of the project 4
1.7 Outcome of the project 4
CHAPTER 2 Software Requirement Analysis 5
2.1 Hardware requirements 5
2.2 Software specifications 5
2.3 Software requirements 6
2.3.1 Anaconda Distribution
2.3.2 Python Libraries
2.3.3 libraries used in the code and their details
CHAPTER 3 Software Design 7
3.1 Architectural Overview 7
3.1.1 Components 7
3.1.2 Interaction 8
3.1.3 Technologies Used 8
3.2 Data flow diagram 9
3.2.1 Level 0 DFD 9
3.2.3 Level 1 DFD 10
3.2.3 Data flow path 10
3.2.4 Data source store 10
3.2.5 External Entities 10
3.2.6 Data Flow Annotations 10
3.2.7 Data Flow Controls 10
3.2.8 Data Flow Optimization 10
3.3 Component Design 11
3.3.1 Data Collection Module 11
3.3.2 Preprocessing Module 11
3.3.3 Model Training Module 11
3.3.4 Prediction Generation Module 12
3.3.5 User Interface Module 12
3.4 Model Architecture 13
3.4.1 Algorithm Selection 13
3.4.2 Input Features 13
3.4.3 Model Architecture 14
3.4.4 Output Formats 14
3.5 Error Handling 14
3.5.1 Error Detection 14
3.5.2 Error Handling Strategies 15
3.6 User Interface Design 15
3.6.1 Design Principles 15
3.6.2 Components and Features 15
3.6.3 Responsive Design 16
3.7 RNN-based Approach 16
3.7.1 Recurrent Neural Networks (RNNs) 16
3.7.2 Long Short-Term Memory Networks (LSTMs) 17
3.7.3 Application in Stock Price Prediction 17
3.7.4 Benefits and Challenges 17
3.7.5 Future Directions
3.8 Conclusion 18
LSTM and RNN models possess the ability to learn from historical data and capture
long-term dependencies, making them well-suited for time series forecasting tasks
such as stock price prediction. By leveraging the inherent memory capabilities of these
neural network architectures, researchers and practitioners aim to improve the
accuracy and robustness of stock price predictions.
In this context, this paper explores the application of LSTM and RNN models in the
domain of stock price prediction. We aim to investigate the potential of deep learning
techniques in overcoming the limitations of traditional methods and enhancing
Overall, this study aims to contribute to the growing body of research on the
application of deep learning in financial forecasting, with a specific focus on stock
price prediction using LSTM and RNN architectures.
1.2 Overview
This project focuses on developing a robust stock price prediction system using
machine learning techniques. By leveraging historical stock data, financial indicators,
and sentiment analysis of news articles and social media data, we aim to forecast stock
prices accurately. The project employs various machine learning algorithms such as
linear regression, decision trees, random forests, and recurrent neural networks
(RNNs) to analyze market trends and patterns. Additionally, we propose a hybrid
approach that combines content-based filtering and collaborative filtering techniques
for enhanced prediction accuracy. Real-world stock market data is utilized for
comprehensive experimentation and evaluation of the proposed methods. The project
aims to contribute to the advancement of stock market prediction methodologies by
providing insights into market dynamics and improving prediction accuracy, thereby
empowering investors and financial analysts to make more informed decisions in the
dynamic realm of financial markets.
1.3 Motivation
The motivation behind this project stems from the critical importance of accurate
stock price prediction in the financial industry. Investors and financial analysts rely
heavily on predictive models to make informed decisions regarding buying, selling,
and holding stocks. However, traditional methods often fall short in capturing the
complexities and nuances of dynamic market behavior. By harnessing the power of
machine learning, we aim to revolutionize stock price prediction by leveraging vast
amounts of historical data and incorporating advanced algorithms to identify
underlying patterns and trends. Additionally, the integration of sentiment analysis
allows us to capture market
1.4 Objective
The objective of this project is to develop a robust stock price prediction system using
machine learning techniques. Our primary aim is to leverage historical stock data and
relevant financial indicators to train predictive models capable of accurately
forecasting stock prices. To achieve this, we plan to explore various machine learning
algorithms, including linear regression, decision trees, random forests, and recurrent
neural networks (RNNs), to analyze market trends and patterns effectively.
Additionally, we intend to integrate sentiment analysis of news articles and social
media data to capture market sentiment and enhance prediction accuracy. Through
comprehensive experimentation with real-world stock market data, we aim to evaluate
the performance of these machine learning techniques rigorously. Ultimately, our
objective is to contribute to the advancement of stock market prediction
methodologies, providing valuable insights into market dynamics and improving
prediction accuracy. This will empower investors and financial analysts with
actionable insights to navigate the complexities of financial markets confidently.
Pandas:
Purpose: Pandas is a powerful data manipulation and analysis library, built on
top of NumPy. It offers data structures like Series and DataFrame, along with
functions for data cleaning, reshaping, merging, and time series analysis.
Use Cases: Data cleaning, data wrangling, exploratory data analysis, and time
series analysis.
Seaborn:
Purpose: Seaborn is a statistical data visualization library based on Matplotlib,
offering a higher-level interface for creating attractive and informative
statistical graphics. It provides functions for visualizing distributions,
relationships, and categorical data.
Use Cases: Statistical data visualization, exploring relationships between
variables, and creating publication-quality plots.
Scikit-learn:
Purpose: Scikit-learn is a machine learning library that provides simple and
efficient tools for data mining and data analysis. It includes a wide range of
algorithms for classification, regression, clustering, dimensionality reduction,
and model selection.
Use Cases: Machine learning tasks such as classification, regression,
clustering, and model evaluation.
TensorFlow:
Purpose: TensorFlow is an open-source machine learning framework
developed by Google for building and training deep learning models. It
provides tools for implementing neural networks, including high-level APIs
like Keras and low-level operations for custom model development.
Use Cases: Deep learning, neural networks, natural language processing,
computer vision, and reinforcement learning.
Keras:
Purpose: Keras is a high-level neural networks API written in Python, capable
of running on top of TensorFlow, Theano, or Microsoft Cognitive Toolkit
(CNTK). It provides a user-friendly interface for building and training deep
learning models with minimal code.
Use Cases: Rapid prototyping, building and training deep learning models
with ease.
3.1.1 Components
Data Collection Module: Responsible for gathering historical stock price
data, financial indicators, and sentiment analysis data from various sources
such as financial databases, APIs, and web scraping.
Pre-processing Module: Handles data cleaning, feature engineering, and
normalization tasks to prepare the raw data for model training and prediction.
3.1.2 Interactions
Data flows from the Data Collection Module to the Pre-processing Module,
where it undergoes cleaning and transformation before being passed to the
Model Training Module.
Trained models from the Model Training Module are deployed within the
Prediction Generation Module, which generates predictions based on user
input and model outputs.
The User Interface Module interacts with all other modules, allowing users to
input data, customize settings, view prediction results, and access system
functionalities.
data, which is then passed to the Preprocessing Module for further processing.
Interactions: The Data Collection Module interacts with the Preprocessing
Module to provide raw data for cleaning and transformation.
interfaces with the Model Training Module to deploy trained models for
generating predictions.
Interactions: The Prediction Generation Module interacts with the User
Interface Module to receive input parameters and with the Model Training
Module to deploy trained models for prediction.
Here are some potential areas for future work in the context of stock price prediction
using deep learning:
Data Augmentation: Explore data augmentation techniques to increase the
size of the training data set and improve the model's ability to generalize to
unseen data.
Feature Engineering: Experiment with different feature engineering
techniques, such as adding technical indicators or incorporating external data
sources, to improve the model's performance.
Model Architecture: Experiment with different model architectures, such as
adding more layers or using different types of layers, to improve the model's
ability to capture complex patterns in the data.
Optimization: Experiment with different optimization techniques, such as
using different optimizers or adjusting the learning rate, to improve the
model's convergence and training time.
Evaluation Metrics: Explore different evaluation metrics, such as using
different loss functions or incorporating additional metrics, to better measure
the model's performance.
Real-time Prediction: Implement a real-time prediction system that can
continuously update the model's predictions as new data becomes available.
These are just a few potential areas for future work in the context of stock price
prediction using deep learning. By exploring these areas, researchers and practitioners
can continue to improve the accuracy and reliability of stock price predictions,
ultimately helping investors make more informed decisions.
3.8 Conclusion
In conclusion, the stock price prediction system offers a powerful tool for investors,
analysts, and financial professionals to make informed decisions and gain insights into
future market trends. This chapter explored various aspects of system design,
including architectural overview, data flow, component design, model architecture,
error handling, scalability, and user interface design. By adopting a comprehensive
approach and prioritizing user-centric design principles, the system aims to deliver a
reliable, efficient, and user-friendly solution for predicting stock prices and analyzing
market trends, providing valuable insights and enhanced decision-making capabilities
across the financial industry.
The Proposed System Make Use Different Algorithms and Methods for the
Implementation of RNN and Approach of Moving averages.
Exponential Moving Average (EMA): EMA gives more weight to recent data
points while still considering older data points. It exponentially decreases the
weight of older observations, making it more responsive to recent changes in
the data series.
[2] Enhancing Profit by Predicting Stock Prices using Deep Neural Networks, IEEE
2019-Soheila Abrishami, et al., The prediction of economic time series is quite a
herculean task, which has fascinated the attentiveness of many scholars and is
extremely vital for investors. This paper focuses on presenting a deep learning system,
which makes use of a range of facts for a part of the stocks on the NASDAQ exchange
to predict the value of the stock. This model has been trained on the smallest of data
for a particular stock and accurately estimates the concluding value of that stock for
multi- stepahead. It consists of an auto encoder in order to remove noise and makes
use of time series data engineering to syndicate the advanced features with the original
features. These new features are given to a Stacked LSTM Autoencoder for multistep-
ahead estimation of the stock concluding value. Further, this estimation is used by a
profit maximization approach to offer assistance on the right time for buying and
selling a particular stock. The results indicate that the suggested framework outclasses
the state of the art time series forecasting methodologies with respect to analytical
accuracy and effectiveness.
[3] An LSTM-Method for Bit-coin Price Prediction: A Case Study Yahoo Finance
Stock Market, IEEE 2019- Ferdiansyah et al., Bit-coin is a type of Cryptocurrency and
currently is one of a kind of investment on the stock market. Stock markets are
inclined by several risks. And bit-coin is one kind of crypto currency that keeps rising
in recent years, and sometimes suddenly falls without knowing influence on the stock
market. There’s a need for automation tools to predict bit-coin on the stock market
because of its fluctuations. This research study studies how to create mode prediction
bit-coin stock market prediction using LSTM. Before confirming the results the paper
tries to measure the results using RMSE (the Root Mean Square Error).The RMSE
will at all times be larger or equal to the MAE. The RMSE metric assesses how well a
model can calculate a continuous value. The method that is applied on this research to
predict Bit-coin on the stock market Yahoo finance can forecast the result above
$12600 USD for the next couple of days after prediction.
[4] Share Price Prediction using Machine Learning Technique, IEEE 2019-Jeevan B
et al., Lately stock market has been the talk of the town with more and more people
from academics and business showing interest in it. This paper mostly deals with the
approach towards predicting stock prices using RNN (Recurrent Neural Network) and
LSTM (Long Short Term Memory) on National Stock Exchange using numerous
elements such as the present-day market price as well as anonymous events. A
recommendation system along with models constructed on RNN and LSTM methods
are used in selecting the company is also mentioned in this paper.
[5] Stock Market Prediction Using Machine Learning Techniques, IEEE 2020-
Naadun Sirimevan et al., The Stock Market Prices play a crucial role in today’
economy. Researchers have discovered that social media platforms such as twitter and
web news tend to influence the decisionmaking process of any individual. In this
research behavioural reflex towards web news is taken into count to reduce the gap
and make the prediction much more accurate. Precise predictions were made for a
day, a week and two weeks here after.
7.6 Conclusion
In conclusion, we reflect on the journey of developing the stock price prediction
system and its significance in the context of financial markets. We highlight the
achievements, contributions, and implications of the project, and express our vision
for future advancements in the field of predictive analytics and algorithmic trading.
[2] Sukhman Singh; Tarun Kumar Madan; Jitendra Kumar; Ashutosh Kumar Singh
(2020) Stock Market Forecasting using Machine Learning: Today and Tomorrow in
National Institute of Technology, Kurukshetra, Haryana, India.
DOI : 10.1109/ICICICT46008.2019.8993160
[3] Ferdiansyah Ferdiansyah; Siti Hajar Othman; Raja Zahilah Raja Md Radzi; Deris
Stiawan; Yoppy Sazaki; Usman Ependi(2020). A LSTM-Method for Bitcoin Price
Prediction: A Case Study Yahoo Finance Stock Market in School of Computing,
Universiti Teknologi Malaysia, Johor Bahru, Johor, Malaysia.
DOI : 10.1109/ICECOS47637.2019.8984499
[4] Meghna Misra; Ajay Prakash Yadav; Harkiran Kaur (2020). Stock Market
Prediction using Machine Learning Algorithms: A Classification Study in Department
of Computer Science and Engineering, (Deemed to be University, Patiala).
DOI : 10.1109/ICRIEECE44171.2018.9009178
[5] Mojtaba Nabipour , Pooyan Nayyeri , Hamed Jabani , Shahab S., (Senior Member,
Ieee), and Amir Mosavi (2020). Predicting Stock Market Trends Using Machine
Learning and Deep Learning Algorithms Via Continuous and Binary Data; a
Comparative Analysis.
DOI : 10.1109/ACCESS.2020.3015966
[7] Sumeet Sarode; Harsha G. Tolani; Prateek Kak; C S Lifna (2019). Stock Price
Prediction Using Machine Learning Techniques in Vivekanand Education Society's
Institute of
Technology, Mumbai, India. DOI: 10.1109/ISS1.2019.8907958
[8] Shao En Gao; Bo Sheng Lin; Chuin-Mu Wang(2019). Share Price Trend Prediction Using
CRNN with LSTM Structure in Department of Computer Science and Information
Engineering, National Chin-Yi University of Technology, Taichung, Taiwan.
DOI: 10.1109/IS3C.2018.00012
[9] Ishita Parmar; Navanshu Agarwal; Sheirsh Saxena; Ridam Arora; Shikhin Gupta;
Himanshu Dhiman; Lokesh Chouhan (2019). Stock Market Prediction Using Machine
Learning in Department of Computer Science and Engineering, National Institute Of
Technology, Hamirpur, INDIA.
DOI : 10.1109/ICSCCC.2018.8703332
[11] Chawalit Jeenanunta; Rujira Chaysiri; Laksmey Thong(2018). Stock Price Prediction
With Long Short-Term Memory Recurrent Neural Network in School of Management
Technology, Thammasat University, Thailand.
DOI : 10.1109/ICESIT-ICICTES.2018.8442069
[12] Mehak Usmani; Syed Hasan Adil; Kamran Raza; Syed Saad Azhar Ali (2016). Stock
market prediction using machine learning techniques in Iqra University, Karachi, PK.
[13] Jae Won Lee (2002). Stock price prediction using reinforcement learning in School of
Computer Science and Engineering, Sungshin Women's University, Seoul, South Korea.
DOI: 10.1109/ISIE.2001.931880