Giter Club home page Giter Club logo

hao507 / chinese-stock-prediction-using-weibo-baidu-news-sentiment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhiaozhou/chinese-stock-prediction-using-weibo-baidu-news-sentiment

0.0 2.0 0.0 85.7 MB

๐Ÿ“ˆ A neural network regression model trained to predict the mean stock price percentage change everyday using financial factors like previous close price, actual previous close price, open price, market capitalization, total market value, price-to-earning ratio and price-to-book ratio, along with corresponding Sina Weibo and Baidu News sentiment scores.

Jupyter Notebook 99.39% Shell 0.01% Python 0.60%

chinese-stock-prediction-using-weibo-baidu-news-sentiment's Introduction

Chinese Stock Prediction Using Weibo & Baidu News Sentiment

This is a research project for NYU CSCI-GA.3033-003-Realtime-and-Big-Data-Analytics. A neural network regression model is trained to predict the mean stock price percentage change everyday using financial factors like previous close price, actual previous close price, open price, market capitalization, total market value, price-to-earning ratio and price-to-book ratio, along with corresponding Sina Weibo and Baidu News sentiment scores. Additionally, a random forest model is also trained as a baseline model. Finally, the results are an RMSE of 0.002 and an RMSE of 0.0015 respectively which are similar.

Programe Design Diagram

Since this project is initiated as a big data management project so several big data tools are used here such as Hadoop Streaming, Spark and etc..

Data

Since the lack of time, only 200 stocks were chosen to be our training set stock list. And the time period is from 2018-01-01 till now.

  1. Sentiment Scores
    Sentiment analysis was performed on the tweets and news titles about the stocks of selected companies using Baidu NLP API which can directly output a sentiment score of a text string.

1.1. Weibos
Sina Weibo is just like Twitter which has its own API. However, to crawl weibos back to more than one month ago can be too expensive. So a crawler is written here using Python to manually scrap stock-related weibos. P.S., a neural network classifier was trained to address the verification code but it didn't succeed so the codes should be inputed manually during crawling.
1.2. Baidu News
Just like Sina Weibo, a crawler is written here using Python. 3. Stock Related Data
All dataset concerning financial factors and stock prices were downloaded from Uqer which is a quant backtesting platform in China.

Finally, a training set of 4564 samples was obtained with predictors: stock id, trade date,sentiment score sum, number of social media, sentiment score mean,weighted sentiment score sum(sentiment score*confidence level), weighted sentiment score mean, previous close price, actual previous close price, open price, market capitalization, total market value, price-to-earning ratio and price-to-book ratio.

Neural Network Architecture

A typical neural network regressor architecture is established here.

Result

For the random forest baseline model, a Root Mean Square Error(RMSE) of 0.0015 was obtained.

Additionally, for the neural network, an RMSE of 0.002 was achieved.

The two results were similar which can be due to the small size of the training set(4564 samples) because when the size of a training set is small, there can be few advantages of a neural network over a random forest.

chinese-stock-prediction-using-weibo-baidu-news-sentiment's People

Contributors

zhiaozhou avatar

Watchers

 avatar  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.