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
$9.99 $29.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (9 Ratings)
eBook Sep 2015 248 pages 1st Edition
eBook
$9.99 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Kumar Ravindran Profile Icon Vikram Garg
Arrow right icon
$9.99 $29.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (9 Ratings)
eBook Sep 2015 248 pages 1st Edition
eBook
$9.99 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$9.99 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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 : 9781784399672
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 23, 2015
Length: 248 pages
Edition : 1st
Language : English
ISBN-13 : 9781784399672
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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 132.97
Machine Learning with R
$54.99
Mastering Social Media Mining with R
$38.99
Learning Bayesian Models with R
$38.99
Total $ 132.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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.