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
$38.99
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
$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
$38.99
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
$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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

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 $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

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela