Stock Price Prediction
Stock Price Prediction using machine learning helps you discover the future value
of company stock and other financial assets traded on an exchange. The entire idea
of predicting stock prices is to gain significant profits. Predicting how the stock
market will perform is a hard task to do. There are other factors involved in the
prediction, such as physical and psychological factors, rational and irrational
behavior, and so on. All these factors combine to make share prices dynamic and
volatile. This makes it very difficult to predict stock prices with high accuracy
. Import the Libraries.
LoadLibraries
2. Load the Training Dataset.
The Google training data has information from 3 Jan 2012 to 30 Dec 2016. There are
five columns. The Open column tells the price at which a stock started trading when
the market opened on a particular day. The Close column refers to the price of an
individual stock when the stock exchange closed the market for the day. The High
column depicts the highest price at which a stock traded during a period. The Low
column tells the lowest price of the period. Volume is the total amount of trading
activity during a period of time.
LoadDataset
3. Use the Open Stock Price Column to Train Your Model.
OpenPrice
4. Normalizing the Dataset.
NormalizingData
. Creating X_train and y_train Data Structures.
TrainingData
ShapeOfData
6. Reshape the Data.
ReshapeData.
7. Building the Model by Importing the Crucial Libraries and Adding Different
Layers to LSTM.
DeepLearningLibraries
BuildingModel
. Fitting the Model.
FitModel.
9. Extracting the Actual Stock Prices of Jan-2017.
TestData
10. Preparing the Input for the Model.
ModelInput.
11. Predicting the Values for Jan 2017 Stock Prices.
PredictStocks