Case study 1 – predicting stock prices based on social media
Our first case study will be quite exciting! We will attempt to predict the price of stock of a publically traded company using only social media sentiment. While this example will not use any explicit statistical/machine learning algorithms we will utilize EDA (exploratory data analysis) and use visuals in order to achieve our goal.
Text sentiment analysis
When talking about sentiment it should be clear what is meant. By sentiment, I am referring to a quantitative value (at the interval level) between -1 and 1. If the sentiment score of a text piece is close to -1, it is said to have negative sentiment. If the sentiment score is close to 1, then the text is said to have positive sentiment. If the sentiment score is close to 0, we say it has neutral sentiment. We will use a Python module called Textblob
to measure our text sentiment:
# use the textblob module to make a function called stringToSentiment that returns a sentences...