Foretelling The Stock Price Behavior Prediction By Top Twenty News Headlines Using Deep Learning & NLP
News headline plays a critical role in determining the stock price behavior that mainly because most of the stockholder makes stock related decisions based on recent news. And that's why the sentiment of the news related to a particular company highly determines whether the stock of that company will grow up, down, or stay the same. To predict this behavior of the stocks I have created a deep learning system that helps to determine how the stock will behave based on the top twenty news headlines.
- Tensorflow
- Keras
- Numpy
- Pandas
- Matplotlib
- Seaborn
- Sklearn
- Spacy
- BeautifulSoup
- Wordcloud
For the prediction of the stock price behaviors with top twenty news headlines, I have created a deep learning model that is divided into two sections, the first section uses two one dimensional convolutional layers each followed by a max-pooling and dropout layer, and the second section uses three fully connected dense neural network layers. All the layers use RELU as an activation function except the last dense layer that uses the sigmoid activation function to map predicted values to probabilities between 0 and 1.
The model has been trained for five epochs. During training, the model uses Adam as an optimizer. The loss function used was mean square error to penalize the model more whenever it makes false predictions.
- Training Data Accuracy: 98%
- Training Data Loss: 0.014
- Test Data Accuracy: 99%
- Test Data Loss: 0.026
In this project, I have created a deep learning model that foretells how the stock price of a company will behave by considering major news headlines with an impressive accuracy of 98 percent.