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

D Y Patil College of Engineering, Ambi

Department Of
Information Technology
Project presentation on
Stock predictions using hybrid Machine Learning and Deep Learning Models
By
Khetre Pawankumar D. 71721140B
Mangalampalli Rahul 71721159C
Pandey Vivekkumar S. 71721189E
Malviya Vaibhav D. 71721301D

Under the guidance of


Prof. Vibha Lahane
Contents
 Abstract (System Overview)
 Problem Statement / Title
 Purpose , Scope and Objective
 Literature Survey
 Neural Networks
 BPNN and it’s Drawbacks
 Linearity and Non- Linearity
 Properties of Time Dependent Data
 Existing System
 Proposed System
 ARIMA
 Differencing
 Auto Regression Model(AR)
 Moving Average Model(MA)
 Training Model using Trial and Error Method
 RNNs and GRU
 GRU structure implementation
 Purpose of using both GRU and ARIMA
 Simulation of the Structure and Technologies Used
 Conclusion
ABSTRACT
 Prediction of stocks requires a lot of knowledge on market
share values and trends.
 This knowledge can be obtained by experience in this
particular field.
 For a normal human it requires a lot of time and energy to
gain experience to predict trends in stock prices.
 With advancement in technology, machine learning
algorithms keep the capability of predicting trends in stocks
because of the huge computational capacity which is
available nowadays.
PROJECT STATEMENT

To predict stock using hybrid Machine Learning and


Deep Learning Models
Purpose, Scope, Objectives
PURPOSE:

 Because of irregular changes in stock prices, investors incur a variable amount of loss. To reduce the loss.
 Investors and organizations are the benefiters.
 Market is volatile each time market turned toward new direction. Volatility means sudden ups and down
in the market that affect share prices and market demand. Stock market is unpredictable because of that
volatility. To reduce this volatility.

OBJECTIVE:
 Because of the stock prediction, the investors will know the condition of stock market and they’ll find
deep insights.

SCOPE:
 The main purpose of the project is to predict the stock in low cost at small scale.
 This project doesn’t cares about any companies or organization’s decision making it totally depends upon
how and when they use it.
Literature Survey
Year of Publication Title Author Abstract
  A Novel Hybrid Model for Stock Mojtaba Sedighi This paper intends to present a new
  Price Forecasting Hossein Jahangirnia model for the accurate forecast of the
  Based on Metaheuristics and Mohsen Gharakhani stock’s future
 
Support Vector Machine Saeed Farahani Fard price. Stock price forecasting is one of
2019
the most complicated issues in view of
the high fluctuation
of the stock exchange and also it is a
key issue for traders and investors.

Predicting Prices of Stock Mohammad Obaidur Rahman In this paper, proposed a model is
Market using Gated Recurrent Md. Sabir Hossain designed to predict the future prices of
Units (GRUs) Neural Networks Ta-Seen Junaid the stock market using Gated
Md. Shafiul Alam Forhad Recurrent Units (GRUs) neural
2019 Muhammad Kamal Hossen networks. The paper depicts changed
internal structure of GRUs in order to
remove local minima problem, reduce
time complexity and other problems of
stochastic gradient descent as well as
improve the efficiency.
  Hybrid Deep Learning Model for Mohammad Asiful Hossain In this paper, we propose a novel
  Stock Price Rezaul Karim stock price
  Prediction Ruppa Thulasiram prediction model based on deep
  Neil D. B. Bruce learning. With the success
  Yang Wang of deep learning algorithms in the field
2018 of Artificial Neural
Network (ANN), we choose to solve
the regression based problems
(stock price prediction in our case).
Literature Survey
Financial Indices Modelling and Marios Mourelatos Prediction and modelling of the
Trading utilizing Thomas Amorgianiotis financial indices is
Deep Learning Techniques Christos Alexakos a very challenging and demanding
2018 Spiridon Likothanassis
problem because its dynamic,
noisy and multivariate nature.
Modern approaches have also to
challenge the fact that they are
dependencies between different
global financial indices.
  Predicting Market Performance Mehak Usmani In this research, a stock market
  with Syed Hasan Adil prediction model
  Hybrid Model Mansoor Ebrahim was proposed to predict performance
 
Kamran Raza of Karachi Stock Exchange
 
2018 (KSE), now merged into Pakistan
Stock Exchange (PSX). The
model was comprised of four sub-
models that were all based on
different machine learning technique.
  Deep Learning for Stock Market Manuel R. Vargas This work uses deep learning models
  Prediction Using Carlos E. M. dos Anjos for daily
  Technical Indicators and Gustavo L. G. Bichara directional movements prediction of a
  Financial News Articles Alexandre G. Evsukoff stock price using financial
  news titles and technical indicators as
  input. A comparison is
  made between two different sets of
  technical indicators, set 1:
2018 Stochastic %K, Stochastic %D,
Momentum, Rate of change,
William’s %R,
Accumulation/Distribution (A/D)
oscillator and
Disparity 5; set 2: Exponential Moving
Average, Moving Average
Convergence-Divergence, Relative
Strength Index, On Balance
Volume and Bollinger Bands.
Literature Survey
Hybrid ARIMA-BPNN Model for Time Li Xiong Stock price prediction is a
Series Prediction of the Chinese Stock Yue Lu challenging task owing to
Market the complexity patterns behind
time series. Autoregressive
2017 integrated moving average
(ARIMA) model and back
propagation neural network
(BPNN) model are popular linear
and nonlinear models for time
series forecasting respectively
Short term stock price prediction Khare Kaustubh Short - term price movements,
using deep learning contribute a substantial live to the
2017 unpredictability of the securities
exchanges. Accurately predicting
the price fluctuations available
market may be a huge economical
advantage.
Classification-based Financial Matthew Dixon Deep neural networks (DNNs) are
Markets Prediction using Deep Diego Klabjan powerful types of artificial neural
Neural Networks Jin Hoon Bang networks (ANNs) that use several
2017 hidden layers.
They have recently gained
considerable attention in the speech
transcription and image recognition
community for their superior
predictive properties including
robustness to overfitting.
Hybrid nonlinear adaptive scheme C.M. Anish Accurate and effective stock price
for stock market prediction using Babita Majhi prediction is very important for
feedback FLANN and factor analysis potential investors in deciding
2016 investment strategy.
Data mining techniques have been
applied to stock market prediction in
recent literature.
Literature Survey
Artificial Neural Networks architectures L. Di Persio Artificial Neural Network (ANN)
for stock price prediction: comparisons O. Honchar approach to predict stock market
and applications indices, particularly with respect
to the forecast of their trend
movements up or down.
Exploiting different Neural
2016 Networks architectures, this
paper provides numerical
analysis of concrete financial time
series. In particular, after a brief
resume of the existing literature
on the subject, it considers the
Multi-layer Perceptron (MLP), the
Convolutional Neural Networks
(CNN), and the Long Short Term
Memory (LSTM) recurrent neural
networks technique
Optimizing Stock Market Price Meryem Ouahilal Predicting stock prices is an
Prediction using a Hybrid Approach Mohammed El Mohajir important task of financial time
Based on HP Filter and Support Mohamed Chahhou series forecasting, which is of great
Vector Regression Badr Eddine El Mohajir interest to stock investors, stock
traders and applied researchers.
Many machine learning techniques
2016 have been used in recent times to
predict the stock price, including
regression algorithms which can be
useful tools to provide good
accuracy of financial time series
forecasting. In this paper, a novel
hybrid approach which combines
Support Vector Regression and
HodrickPrescott filter in order to
optimize the prediction of stock price
has been proposed
Literature Survey
A Hybrid Fuzzy Time Series Model Chung-Ho Su this paper proposes a novel
Based on ANFIS and Integrated Ching-Hsue Cheng ANFIS (Adaptive Neuro Fuzzy
Nonlinear Feature Selection Method Inference System) time series
for Forecasting Stock
model based on integrated
2016 nonlinear feature selection (INFS)
method for stock forecasting.
This paper proposes a novel
ANFIS (Adaptive Neuro Fuzzy
Inference System) time series
model based on integrated
nonlinear feature selection (INFS)
method for stock forecasting.
A Naïve SVM-KNN based stock Rudra Kalyan Nayaka This paper proposes a hybridized
market trend reversal analysis for Debahuti Mishraa, framework of Support Vector
Indian benchmark indices Amiya Kumar Rathb Machine (SVM) with K-Nearest
Neighbor approach for Indian stock
market indices prediction.
2015 The objective of this paper is to get
in-depth knowledge in the stock
market in Indian Scenario with the
two indices such as, Bombay Stock
Exchange (BSE Sensex) and CNX
Nifty using technical analysis
methods and tools such as
predicting closing price, volatility and
momentum of the stock market for
the available data.
Dynamic Business Network Analysis Wenping Zhang This paper discusses about a novel
for Correlated Stock Price ChunpingLi Yunming Ye business networkbased model can
2015 Movement Prediction Wenjie Li help predict directional stock price
Eric W.T. Ngai movements by considering both
influential business relationships
and Twitter sentiment.
Comparison of ARIMA and Artificial Ayodele Ariyo Adebiyi This paper examines the forecasting
2014 Neural Networks Models for Stock Aderemi Oluyinka Adewumi performance of ARIMA and artificial
Price Prediction Charles Korede Ayo neural networks model with
published stock data obtained from
New York Stock Exchange.
Literature Survey
A moving-average filter based hybrid C. Narendra Babu The linear autoregressive
ARIMA-ANN model for forecasting time B. Eswara Reddy integrated moving average
series data (ARIMA) and nonlinear artificial
2014 neural network (ANN) models s
explored during this paper to plan
a brand new hybrid ARIMA-
ANN model for the prediction of
your time series knowledge.
Stock index forecasting based on a J.J. Wang This paper examines the prediction
hybrid model J. Z. Wang performance of ARIMA and artificial
2012 Z. G. Zhang neural networks model with obtained
S. P Guo stock information from New York
Stock Exchange.
Time series forecasting using a G. P. Zhang Autoregressive integrated moving
hybrid ARIMA and neural network average (ARIMA) is one of the
model popular linear models in time series
2003 forecasting during the past three
decades. Recent research activities
in forecasting with artificial neural
networks (ANNs) suggest that ANNs
can be a promising alternative to the
traditional linear methods.
Backpropagation through time: what P.J Werbos This paper reviews the basic idea of
it does and how to do it backpropagation, a simple method
1990 which is being widely used in areas
like pattern recognition and fault
diagnosis.
It further expands the idea of dealing
with recurrent networks, systems
involving simultaneous equations.
Neural Network
 Neural networks are a set of
algorithms, modelled loosely
after the human brain, that
are designed to recognize
patterns.
 They interpret sensory data
through a kind of machine
perception, labelling or
clustering raw input. 
 The patterns they recognize
are numerical, contained in
vectors, into which all real-
world data, be it images,
sound, text or time series,
must be translated.
Input Layer
 The input layer is responsible for
receiving the inputs. These
inputs can be loaded from an
external source such as a web
service or a csv file.
 There must always be one input
layer in a neural network. The
input layer takes in the inputs,
performs the calculations via its
neurons and then the output is
transmitted onto the subsequent
layers.
 The number of neurons in an
input layer is dependent on the
shape of your training data.
Output Layer:
 The output layer is
responsible for producing
the final result. There must
always be one output layer
in a neural network.
 The output layer takes in
the inputs which are passed
in from the layers before it,
performs the calculations
via its neurons and then the
output is computed.
Hidden Layer
 Hidden Layers reside between
Input and Output Layers and
this is the primary reason they
are referred as Hidden Layers.
 There can be zero or more
than zero Hidden Layers in a
neural network .
 Usually, the hidden layer
contains same number of
neurons.
 The larger the number of
hidden layers, the longer it will
take to get desired output and
more complex problems can
be solved by neural network.
Back Propagation Neural Network
 To propagate is to transmit
something (light, sound,
motion or information) in a
particular direction or through
a particular medium.
 When we discuss
backpropagation in deep
learning, we are talking about
the transmission of
information, and that
information relates to the
error produced by the neural
network when it makes a
guess about data.
Vanishing Gradient Problem
 When the architecture
becomes deeper.
Temporal dependencies
go on increasing.
 These dependencies
can’t be captured by
neural networks even
though they huge
architectural strength.
 To avoid such problems a
memory unit is needed
to remember those
temporal changes in
data.
Linearity and Non Linearity
 Time series data consist of two components
linearity and non-linearity data
 When data points increase or decrease steadily in
certain direction, then it’s said to posses the
property of linearity.

Linear data
 When data points increase or decrease abruptly in
undefined directions, then it’s said to posses the
property of non-linearity.
 It’s exact opposite of property of linearity in data

Non-linear data
Properties of Time Dependent Data

1. Trend:
◦ The increasing or
decreasing value in
the series.

2. Seasonality :
The repeating short-
term cycle in the
series
Existing System

ARIMA
Input Output

Info of days till T+1 price and


T T+n trend

BPNN

I O
H
Proposed System

ARIMA
Input Output

Info of days till T+1 price and


T T+n trend

GRU

Y1 Y2 Y3 Y4

H2 H3 H4
H1 Unit 1 Unit 2 Unit 3 Unit 4

X1 X2 X3 X4
ARIMA MODEL
• ARIMA stands for Autoregressive Integrated Moving-average.
• A “Stochastic” modeling approach that can be used to
calculate the probability of a future value lying between two
specified limits.
• ARIMA model is combination of two models.
AR model and MA model
• AR stands for Autoregressive Model.
• MA stands for Moving Average Model.
• I is integrated part of the model which handles differencing.
Differencing

 Difference transform is used to remove the series dependence


on time. This includes structures like trends and seasonality.
 Differencing is performed by subtracting the previous
observation from the current observation.
 Difference(t) = observation(t) - observation(t-1)
 By differencing the data irregularities like seasonality and trend
are removed.
AR(Auto Regression Model)
• Series current values depend on its own previous values.
• AR(p) - Current values depend on its own p-previous values.
• P defines the lag values which are taken into consideration.

mt = value at time t
β0 = intercept
βi = coefficient of impact ; i=1,2,3,......,n
Єt = white noise
MA(Moving Average Model)
• The current deviation from mean depends on previous
deviations.
• MA(q) - The current deviation from mean depends on q-
previous deviations.
• q defines the lag values of the error terms.

ft = value at time t
μ = mean of all values
Φi= coefficient of impact; i=1,2,3,.......,n
Єt-i = error of the lags;i=1,2,3,.....,n
Trail and Error Method
Yt Integration filter AR filter MA filter εt (White noise error)

Differencing the series Estimate the


Identify the model parameters of the
to achieve stationary model

NO Diagnostic
checking.

Use Model for


forecasting Yes
What are Recurrent Neural Networks:
 Recurrent Neural Network(RNN) are a type of Neural
Network where the output from previous step are fed as input
to the current step.
On+1
O O1 O2

RNN RNN RNN RNN

X O O1 On
Gated Recurrent Unit(GRU):
 GRUs are improved version of standard recurrent
neural network.
 GRU process each and every vector sequentially.
 To solve the vanishing gradient problem, GRU
introduces hidden state structure in it’s architecture.
 Previous Hidden
state is passed on
to current neuron
 Current Input is
added up with
previous hidden
state.
 New hidden state
is passed on to
next neuron
present in the
layer.
 Update Gate: It decides what
information to throw away and
what new information to add.

 Reset Gate: The reset gate is


another gate is used to decide
how much past information to
forget.
GRU Structure Implemented

GRU Drop GRU Drop GRU Drop


1 1 2 2 3 2

Dense

O
Purpose of Using both ARIMA and GRU
 In this proposed system, linearity in the data is
handled by ARIMA and non-linearity is handled by
GRU.
 ARIMA predicts t+1 days price and GRU predicts
t+n(t+60 used in this model) days trend.

t+n
trend
ARIMA GRU
t+1 price
t+1
price
Results on Test-Set:
 ARIMA-BPNN
Model:

 ARIMA-GRU
Model:
Technologies Used
 Python Frameworks: Statsmodels, Keras, Tensorflow,
Numpy, Pandas

 FrontEnd: Flask Server and HTML

 Processors: Intel i7 Dual Core CPU


Conclusion
 Space complexity is not at all a problem these days
but time complexity will always remain as a negative
factor for any hybrid algorithms.
 These algorithms needed to be adaptive in nature
and get trained to the newest data available in the
market. So henceforth, when a new trend is observed
is tend to be observed in the market.
 Then these changes must already have been
predicted by the model.
 So the level of training done for the model must be
advance in nature.

You might also like