Giter Site home page Giter Site logo

nlp-stock-price-prediction's Introduction

NLP-stock-price-prediction

This package applies natural language processing on real world news to predict whether stock markets will go up or down.

Data

The dataset was taken retrieved from the Kaggle competition Daily News for Stock Market Prediction on August 19th, 2019.

There are two sources of data:

  • the r/worldnews Reddit - the top 25 headlines ranked by upvotes
  • Yahoo Finance

Model

The model predicts the daily movement of the Dow Jones Industrial Average (DJIA). The task is formulated as a binary classification task:

  • 0 when DJIA Adj Close value decreased
  • 1 when DJIA Adj Close value rose or stayed as the same

The model was found to have ~95% accuracy when analyzing news from the same day. When forecasting tomorrows market movements, accuracy fall to under 60%

Architecture

The majority of model accuracy can be attributed to NLP processing of r/worldnews. Lemmatizing was used on a feature set of 20,000 words, accuracy was seen to improve dramatically with word count.

Analysis of text sentiment and subjectivity also contributed positively. Interpolation and Principal Component Analysis were both found to be useful when cleaning and engineering the Yahoo Finance dataset.

How to use

The model is executed as a series of bash scripts.

First, the two datasets are cleaned are processed:

python3 news.py
python3 number.py

Next, the two resultant cleaned datasets are merged:

python3 merge.py

Finally, the merged dataset is processed to train a logistic regression model:

python3 model.py

nlp-stock-price-prediction's People

Contributors

adgefficiency avatar edithchorev avatar mackdelany 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.