Professional Documents
Culture Documents
Stock Price Prediction
Stock Price Prediction
Stock Price Prediction
INTRODUCTION
● A stock market is a public market for
the trading of company stock.
● Stock market allows us to buy and sell
units of stocks (ownership) of a
company.
● If the company’s profits go up,then we
own some of the profits and if they go
down, then we lose profits with them.
● If more sellers than buyers, stock
prices tend to fall. Conversely, when
more buyers than sellers, stock prices
tend to rise
INTRODUCTION
Loss Profit
Actual Close
5
Predicted Close
DATASET
The data used in this project is of the Alphabet Inc3 from January 1, 2005 to July
30, 2017, this is a series of data points indexed in time order or a time series. Our
goal was to predict the closing price for any given date after training
6
FEATURE IMPORTANCE
● Process of selecting a subset of relevant features for use in model construction.
● Feature selection methods include and exclude attributes present in the data without
changing them.
● Here, in our case ‘Date’,‘High’ and ‘Low’ attributes are dropped.
Dropped
7
FEATURE IMPORTANCE
● Process of selecting a subset of relevant features for use in model construction.
● Feature selection methods include and exclude attributes present in the data without
changing them.
● Here, in our case ‘Date’,‘High’ and ‘Low’ attributes are dropped.
8
Denormalized Dataset Normalized Dataset
9
SO, WHAT ARE THE DIFFERENT MODELS
AVAILABLE?
10
APPROACHES TO SOLVE
● Linear Regression
11
LINEAR REGRESSION Now, you can predict Closing
price along this line
● Linear regression is an
approach for predictive
modeling to showcase the
relationship between a scalar
dependent variable ‘Y’, (in
our case, we have ‘Close’
Close
attribute) and one or more
independent variables ‘X’
(‘Trading day’ attribute).
trading days
12
LINEAR REGRESSION
Predicted Day
Close Vector Vector
This equation
represents this line
Weights Bias
13
Initially, we will take some random weights and bias to initialize.
LINEAR REGRESSION
● Initially, we have some
random weight and bias, so
it will look like this.
14
LINEAR REGRESSION
Mean Squared Error
15
LINEAR REGRESSION
LINEAR REGRESSION
Mean Squared Error
17
LINEAR REGRESSION
RECURRENT NEURAL NETWORK Today’s opening
price
Information related to
previous predicted
Current state Closing price
hidden layer
output
So, it does not allow it to learn from past data as was expected.
RECURRENT NEURAL NETWORK + LSTM
LSTM (Long Short Term Memory)
LSTM
RECURRENT NEURAL NETWORK + LSTM
LSTM (How it works?)
forget gate
RECURRENT NEURAL NETWORK + LSTM
LSTM (How it works?)
Past information
of this state Current closing
Price
RECURRENT NEURAL NETWORK + LSTM
LSTM (How it works?)
required for
updating the
weight
RECURRENT NEURAL NETWORK + LSTM
LSTM (How it works?)
New Cell
state
RECURRENT NEURAL NETWORK + LSTM
LSTM (How it works?)