Generate Stock Features

First save stock tweets locally before generating stock features:

Stock features are generated based on tweets made about a stock within a range of dates. For each stock, user tweets are first filtered to only include tweets made by 'expert' users determined by pre-generated user features. The general purpose of these stock features is to associate a user's tweeted prediction with their corresponding user feature. Example stock feature

for symbol in stocks:
    for date in date_range:
        tweets = findTweets(symbol, date)
        for tweet in tweets:
            username = tweet['username']
            date = tweet['time']
            user_feature = findUserFeature(symbol, date, date)

The tweets for each stock and date are first fetched and scanned. For each tweet, the user's features are found and saved with the tweet.

Notes about these features

  • Features are generated by only looking at the latest prediction by a user on a given day.

  • A user's associated feature is found by looking at the most recent updated feature before the current prediction date

Last updated