Git Product home page Git Product logo

stock-price-sentiment-analysis-with-news-headlines's Introduction

Stock Price Trend Prediction

Project Background

The movement in the stock market is affected by lots of factors including inflation and interest rates, international events, and financial reports directly and indirectly. The latest revealed news and information could impact investors’ demand for stocks and thus become influential to the stock price. Therefore, in this project, we focus on a document classification NLP problem. More specifically, we conducted sentiment analysis by using daily news headlines to predict stock market movement. Two stock market prediction models were established and compared as a result.

Project Description

For this project, we trained both the Naive Bayes model (the generative probabilistic model) and the LSTM model (the discriminative neural network) to perform sentiment analysis to predict stock market movement using the daily news headlines dataset. These two approaches are applied to both the real-world data and the synthetic data generated from the Naive Bayes model. In conclusion, in both “real” data and synthetic data cases, our Naive Bayes model performs better than the LSTM model in terms of higher model accuracy and lower model complexity in terms of time and space.

Result

Confusion Matrix of Naive Bayes Model and LSTM Model for Real-world Data: Confusion Matrix of Naive Bayes Model and LSTM Model for Real-world Data

Accuracy of LSTM Model for Real-world Data: Accuracy of LSTM Model for Real-world Data

The low validation accuracy of the LSTM model could be adjusted by the small size of training data (with only 1989 entries). Moreover, the newsheadlines were collected from the news all over the world, while only DJIA Adj Close Value only reflects the stock market index in the US.

Full Report (Link)

References

C.D. Manning, P. Raghavan and H. Schuetze (2008). Introduction to Information Retrieval. Cambridge University Press, pp. 234-265. Retrieved Dec 11, 2022, from https://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html

Scikit-learn: Machine Learning in Python, Pedregosa, et al., JMLR 12, pp. 2825-2830, 2011.

Sun, J. (2016, August). Daily News for Stock Market Prediction. Kaggle. Retrieved November 16, 2022, from https://www.kaggle.com/aaron7sun/stocknews

stock-price-sentiment-analysis-with-news-headlines's People

Contributors

alisa0705 avatar jennyshen056 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.