Exercise

Fitting an LDA

It's time to run your first topic model! As discussed, the three additional arguments of the LDA() function are critical for properly running a topic model. Note that running the LDA() function could take about 10 seconds. The tidyverse and tidytext packages along with the tidy_twitter dataset have been loaded for you.

Instructions

100 XP
  • Load the topicmodels package.
  • Cast the word counts by tweet into a DTM.
  • Run an LDA with 2 topics and a Gibbs sampler.