辅导Stock Market、讲解Python程序设计、辅导FINAL PROJECT、讲解Python编程
- 首页 >> Python编程FINAL PROJECT: Analysis of President Trump’s Tweets and Stock Market performance.
The project will involve textual pre-processing, data cleaning, word embedding, and running regressions
in Python. There are two parts to it.
Part I requires you to clean twitter data and look for relevant words. You need to find tweets containing
the word stock (for stock market) and a second a term of your own choosing. For instance, you can look
for tweets talking about china, war, trade, unfair, great, border, refugee (anything really). Then you will
merge twitter data with stock market indices. Here also you will run some word embedding and see
what word2vec model can learn about meaning of words through Trump’s tweets.
In Part II you will run regressions on stock market indices. You need to run regressions for:
One of the dummy variables has to be a dummy for stock tweets and the second one of your choice (i.e.
dummy for tweets mentioning china, war, trade and so on). Also for your second term, you need run
additional regressions with sentiment analysis dummies (positive and negative). You will run these
regressions for 2 time periods (2010- now and 2016-now). There are 12 indices, so in total you will have
96 regressions.
There are additional details in Python script/file itself on what to do and what’s required.
For this project, I would highly recommend everyone to use Jupyter Notebook. Jupyter Notebook is
another Python code reader, but it allows you to run one line at a time, and it will be extremely useful
for this project.
Instructions to Install Jupyter Notebook for Mac Users:
1. Pip3 install jupyter notebook
Windows Users:
1. Python -m pip install jupyter notebook
Here is a tutorial/article on how to use it from CodeAcademy.
The due date for this project is midnight of December 7th. You will need to submit the following three
things:
1. Python code
2. (HTML) Output of regressions
3. Word File:
a. Interpretations of regression output
b. Limitations of these regressions
You will need to download Part I and Part II Python files (available both in Jupyter Notebook and plain
Python format) and stock market data csv.
For this assignment you can work in groups. At most there can be 3 people in a group, and you can work
on the same code and write-up. However, for each member of the group, there should be a
corresponding number of extra terms (i.e. tweets containing the word “stock” + extra terms, such as
trade, war, border, refugee). For extra terms, do not forget to do the sentiment analysis and run all the
regressions. When submitting the assignment as a group, submit the same version of the code and
write-up separately so it is easier to track who submitted what.