Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Mastering Social Media Mining with R
Mastering Social Media Mining with R

Mastering Social Media Mining with R: Extract valuable data from your social media sites and make better business decisions using R

Arrow left icon
Profile Icon Kumar Ravindran Profile Icon Vikram Garg
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (9 Ratings)
Paperback Sep 2015 248 pages 1st Edition
eBook
Can$12.99 Can$39.99
Paperback
Can$49.99
Subscription
Free Trial
Arrow left icon
Profile Icon Kumar Ravindran Profile Icon Vikram Garg
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (9 Ratings)
Paperback Sep 2015 248 pages 1st Edition
eBook
Can$12.99 Can$39.99
Paperback
Can$49.99
Subscription
Free Trial
eBook
Can$12.99 Can$39.99
Paperback
Can$49.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering Social Media Mining with R

Chapter 2. Mining Opinions, Exploring Trends, and More with Twitter

Our approach in this book is to use statistics and social science theory to mine social media, and we'll use R as our base programming language.

In this chapter, we will cover the following:

  • Twitter and its importance
  • Getting hands-on with Twitter's data and using various Twitter APIs
  • Use of data to solve business problems—comparison of various businesses based on tweets

Twitter and its importance

Twitter can be considered an extension of the short messages service, or SMS, but on an Internet-based platform. In the words of Jack Dorsey, co-founder and co-creator of Twitter:

"...We came across the word 'twitter', and it was just perfect. The definition was 'a short burst of inconsequential information,' and 'chirps from birds'. And that's exactly what the product was."

Twitter acts as a utility with which people can send their SMSs to the whole world. It enables people to instantaneously get heard and get a response. Since the audience of this SMS is so large, responses are often very quick. Twitter facilitates the basic social instincts of humans. By sharing on Twitter, a user can easily express his/her opinion for just about everything, and at any time. Friends who are connected, or, in the case of Twitter, followers, immediately get the information about what's going on in someone's life. This in turn...

Understanding Twitter's APIs

Twitter APIs provide a means to access the Twitter data; that is, tweets sent by its millions of users. Let's get to know these APIs a bit better.

Twitter vocabulary

As described earlier, Twitter is a microblogging service with a social aspect. It allows its users to express their views/sentiments through an Internet SMS, called "tweets" in the context of Twitter. These tweets are entities formed of maximum of 140 characters. The content of these tweets can be anything ranging from a person's mood to person's location to a person's curiosity. The platform on which these tweets are posted is called a Timeline. To use Twitter's APIs, one must understand the basic terminology.

Tweets are the crux of Twitter. Theoretically, a tweet is just 140 characters of text content tweeted by a user, but there is more to it than just that. There is more metadata associated with the same tweet, which are classified by Twitter as entities...

Creating a Twitter API connection

We need to have an app created at https://dev.twitter.com/apps before making any API requests to Twitter. It's a standard method for developers to gain API access, and, more importantly, it helps Twitter to observe and restricts developer from making high load API requests.

The ROAuth package is the one we are going to use in our experiments. Recall that in Chapter 1, Fundamentals of Mining, we discussed a lot about the OAuth protocol to for obtaining tokens. These tokens allow users to authorize third-party apps to access the data from any user account without the need to have their passwords (or other sensitive information). ROAuth basically facilitates the same thing.

Creating a new app

The first step toward getting any kind of token access from Twitter is to create an app on it. You have to go to https://dev.twitter.com/ and log in with your Twitter credentials. Having logged in using your credentials, the step for creating an app are as follows:

  1. Go...

Twitter sentiment analysis

Depending on the objective, and based on the functionality to search any type of tweets from the public timeline, one can always collect the required corpus. For example, you may want to learn about customer satisfaction levels with various cab services, which are up and coming in the Indian market. These start-ups are offering various discounts and coupons to attract customers, but at the end of the day, the service quality determines the business of any organization. These start-ups are constantly promoting themselves on various social media websites. Customers are showing various sentiments on the same platform.

Let's target the following:

  • Meru Cabs: A radio cabs service based in Mumbai, India, launched in 2007
  • Ola Cabs: A taxi aggregator company based in Bangalore, India, launched in 2011
  • TaxiForSure: A taxi aggregator company based in Bangalore, India, launched in 2011
  • Uber India: A taxi aggregator company headquartered in San Francisco, California, launched...

Summary

In this chapter, you gained knowledge of the various Twitter APIs. We discussed how to create a connection with Twitter, and we saw how to retrieve tweets with various attributes. We saw the power of Twitter in helping us determine customers' attitudes toward today's various businesses. The activity can be done on a weekly basis, and one easily get the monthly, quarterly, or yearly changes in customer sentiment. This can not only help the customer decide the trending business, but also the business itself can get a well-defined metric of its own performance. It can use such scores/graphs to improve. We also discussed various methods of sentiment analysis, varying from basic word-matching the advanced Bayesian algorithms. In the next chapter, we will apply a similar analysis to Facebook.

Left arrow icon Right arrow icon

Key benefits

  • Explore the social media APIs in R to capture data and tame it
  • Employ the machine learning capabilities of R to gain optimal business value
  • A hands-on guide with real-world examples to help you take advantage of the vast opportunities that come with social media data

Description

With an increase in the number of users on the web, the content generated has increased substantially, bringing in the need to gain insights into the untapped gold mine that is social media data. For computational statistics, R has an advantage over other languages in providing readily-available data extraction and transformation packages, making it easier to carry out your ETL tasks. Along with this, its data visualization packages help users get a better understanding of the underlying data distributions while its range of "standard" statistical packages simplify analysis of the data. This book will teach you how powerful business cases are solved by applying machine learning techniques on social media data. You will learn about important and recent developments in the field of social media, along with a few advanced topics such as Open Authorization (OAuth). Through practical examples, you will access data from R using APIs of various social media sites such as Twitter, Facebook, Instagram, GitHub, Foursquare, LinkedIn, Blogger, and other networks. We will provide you with detailed explanations on the implementation of various use cases using R programming. With this handy guide, you will be ready to embark on your journey as an independent social media analyst.

Who is this book for?

If you have basic knowledge of R in terms of its libraries and are aware of different machine learning techniques, this book is for you. Those with experience in data analysis who are interested in mining social media data will find this book useful.

What you will learn

  • • Access APIs of popular social media sites and extract data
  • • Perform sentiment analysis and identify trending topics
  • • Measure CTR performance for social media campaigns
  • • Implement exploratory data analysis and correlation analysis
  • • Build a logistic regression model to detect spam messages
  • • Construct clusters of pictures using the K-means algorithm and identify popular personalities and destinations
  • • Develop recommendation systems using Collaborative Filtering and the Apriori algorithm

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 23, 2015
Length: 248 pages
Edition : 1st
Language : English
ISBN-13 : 9781784396312
Category :
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 23, 2015
Length: 248 pages
Edition : 1st
Language : English
ISBN-13 : 9781784396312
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 169.97
Machine Learning with R
Can$69.99
Mastering Social Media Mining with R
Can$49.99
Learning Bayesian Models with R
Can$49.99
Total Can$ 169.97 Stars icon
Banner background image

Table of Contents

7 Chapters
1. Fundamentals of Mining Chevron down icon Chevron up icon
2. Mining Opinions, Exploring Trends, and More with Twitter Chevron down icon Chevron up icon
3. Find Friends on Facebook Chevron down icon Chevron up icon
4. Finding Popular Photos on Instagram Chevron down icon Chevron up icon
5. Let's Build Software with GitHub Chevron down icon Chevron up icon
6. More Social Media Websites Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(9 Ratings)
5 star 66.7%
4 star 22.2%
3 star 0%
2 star 11.1%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Shanmuga Bharathi Sep 25, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The use cases that are provided for R programming are very useful and gives you an insight on how it can be applied to extract information from data that is available for free in the internet!If you are a beginner at data mining and would like to know more about the APIs that are available to tap information from available data, develop recommendation engines based on the trend and sentiment of online user base, this book is an amazing guide!Would strongly recommend this to my friends!
Amazon Verified review Amazon
Amir Aghamousa Aug 30, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The Mastering Social Media Mining with R is a great book in social media analysis. The book starts with the basic of social media mining and explains variety of concepts and tools which are necessary to know. It offers a comprehensive explanations of doing data mining from Twitter, Facebook, Instagram and Github in four chapters. The explanations are step by step from registration and extracting data to presenting final inferences with introducing the related R packages. Among these chapters one can learn many essential techniques and concepts like sentiment analysis, measuring Click-Through Rate (CTR) performance, network analysis, building recommendation system, exploratory data analysis, correlation analysis, ... . The last chapter of this book shows how to access the other social media websites like Foursquare, LinkedIn, Blogger, Wikipedia, ... through APIs using related R packages. This book is a collection of essential methodologies which one needs to know for social media analysis but the basic knowledge of machine learning algorithm and R programing is necessary for readers.
Amazon Verified review Amazon
derick jose Oct 19, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A book by practitioners for practitioners. Hands on tips which provide a step by step approach to mining social data and inferring sentiments, assessing new product launches and benchmarking competitive products. The language is simple and accessible. If you are planning to do social listening this is a great starting point
Amazon Verified review Amazon
TRUNGNHAN PHAN Dec 01, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is my favorite book on social media covering almost everything I need: getting authentication from the social website (Open Authorization), data preprocessing, data modeling, and sentiment analysis with examples from the most popular social media sites such as Twitter, Facebook, Instagram and GitHub.The best part is that it’s a concise and practical book guiding you step by step packed with code and datasets for almost every chapter in the book except chapter one which is just an introduction.
Amazon Verified review Amazon
Konstantin Danilkov Dec 01, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book, like all other books from the same author, helps a lot to understand the problem for the beginners. The same time covers a lot of interesting R techniques.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.