Giter Club home page Giter Club logo

stock-price-prediction's Introduction

Comparision of various ML Models for Stock Price Prediction

Introduction:

Predicting stock price of Infosys stock using sentiments gathered from newsheadlines. Comparing CNN and LSTM models for prediction. Finding out whether news headlines affects the price.

Problem Statement

News headlines have a great impact on people while making their tradingdecisions. Many people don’t have much time or tend to avoid reading the wholenews and just take a buy or sell call on the basis of the headlines. ▪ There is a common belief that if the news is positive then more people areattracted to invest and therefore the stock price of that particular company mayrise and vice-versa.

Case 1: Infosys shares at record high after winning billion-dollar deal from Daimler AG (Date: 23 December, 2020)
Type: Positive News Result: Change in price 2.31% positive

Case 2: CBI charges DHFL founders with fraud in Pradhan Mantri Awas Yojana (Date: 24 March, 2021)
Type: Negative news Result: Change in price 4.87% negative

Proposed System

  1. First, the historical data of INFOSYS was collected from yahoo finance. The dataset contained data from 01-04-2016 to 01-04-2021. ▪
  2. Scraping news data of INFOSYS from google news using Google News API in Python and storing it in a CSV file.
  3. Perform sentiment analysis on news headlines using the NLTK module of python for natural language processing and VADER Lexicon.
  4. After performing a sentiment analysis of news headlines, we got the polarity score (compound, negative, neutral, positive).
  5. Then, we merged the final output of sentiment analysis with the historical stock data to get the final dataset for evaluation of models. The final dataset after considering required fields is shown in table.

Dataset

Proposed System (Without Sentiments)

Proposed System (With Sentiments)

Results

Results Metrics

Predicted Stock Value (Without Sentiments)

Predicted Stock Value (With Sentiments)

Conclusion:

LSTM gives better results in comparison to CNN. A weak correlation was found between sentiments and closing price as the data gathered is not perfect. To increase the performance of models, it is required that the sentiments gathered are accurate which requires human intervention or advance preprocessing of data to overcome the limitations of API. Further, the same implementation can be carried out on stocks of different sectors to reach a definite conclusion. Also, hybrid models can be made of LSTM and CNN to increase the performance.

stock-price-prediction's People

Contributors

smeet2804 avatar

Watchers

 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.