I recently took up a few courses on machine learning and python, so thought of doing some practice on my new skills and hence decided to work on Nifty50 dataset.
The task I took up was to forecast the move of Nifty50 index using deep learning. I know it is childish of me to predict the move of such a dynamic index and I might not get any meaningful results however, it is always fun to try out things than just have the theoretical knowledge.
Approach 1 - Using simple ANN with multiple features
Steps:
- Merge Nifty50 datasets - Index Price, Volume, PE, PB, VIX, FII & DII activity
- Clean up the master dataset
- Identify key features from the master dataset
- Split the data into training and test sets
- Apply feature scaling
- Build artificial neural network using TensorFlow and train the model
- Evaluate the model and predict the outcome
- Refine the model and reiterate <-- This step is in the loop and the loop is not over yet :)
Libraries used:
- numpy, pandas, tensorflow, sklearn, matplotlib, seaborn
So far the results are not much encouraging. However, I am planning to continue working on it and refine the model.
Approach 2 - Running LTSM on time series index value
Model Architecture
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
lstm (LSTM) (None, 60, 64) 16896
dropout (Dropout) (None, 60, 64) 0
lstm_1 (LSTM) (None, 60, 64) 33024
dropout_1 (Dropout) (None, 60, 64) 0
lstm_2 (LSTM) (None, 60, 64) 33024
dropout_2 (Dropout) (None, 60, 64) 0
lstm_3 (LSTM) (None, 64) 33024
dropout_3 (Dropout) (None, 64) 0
dense (Dense) (None, 1) 65
=================================================================
Output:
Observations:
Looks like the stip drop due to Covid and sudden v shape recovery followed by it is affecting model prediction.
P.S.: Comments, suggestions, and collaborations are welcome :)
Comments
Post a Comment