Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Predictive Analytics with R, Second Edition

You're reading from   Mastering Predictive Analytics with R, Second Edition Machine learning techniques for advanced models

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher Packt
ISBN-13 9781787121393
Length 448 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
James D. Miller James D. Miller
Author Profile Icon James D. Miller
James D. Miller
Rui Miguel Forte Rui Miguel Forte
Author Profile Icon Rui Miguel Forte
Rui Miguel Forte
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Gearing Up for Predictive Modeling FREE CHAPTER 2. Tidying Data and Measuring Performance 3. Linear Regression 4. Generalized Linear Models 5. Neural Networks 6. Support Vector Machines 7. Tree-Based Methods 8. Dimensionality Reduction 9. Ensemble Methods 10. Probabilistic Graphical Models 11. Topic Modeling 12. Recommendation Systems 13. Scaling Up 14. Deep Learning Index

Modeling tweet topics


In machine learning and natural language processing, a topic model is a type of statistical model used to discover the abstract topics that occur in a collection of documents. A good example or use case to illustrate this concept is Twitter. Suppose we could analyze an individual's (or an organization's) tweets to discover any overriding trend. Let's look at a simple example.

If you have a Twitter account, you can perform this exercise pretty easily (you can then apply the same process to an archive of tweets you want to focus on and/or model). First, we need to create a tweet archive file.

Under Settings, you can submit a request to receive your tweets in an archive file. Once it's ready, you'll get an email with a link to download it:

And then save your file locally:

Now that we have a data source to work with, we can move the tweets into a list object (we'll call it x) and then convert that into an R data frame object (df1):

The tweets were first converted to a data frame...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime