Big Data/Analytics Zone is brought to you in partnership with:

Treasure Data's Big Data as-a-Service cloud platform enables data-driven businesses to focus their precious development resources on their applications, not on mundane, time-consuming integration and operational tasks. Our pre-built, multi-tenancy cloud platform is already in use by over 50 customers worldwide and is managing more than 200 billion rows of data and processing 130,000 jobs per day. Discover how Treasure Data can help you focus on your core business and benefit from the fastest time-to-answer service available. Sadayuki is a DZone MVB and is not an employee of DZone and has posted 27 posts at DZone. You can read more from them at their website. View Full User Profile

Understanding the Book-Crossing Dataset: Visualizing Status Data

09.15.2012
| 3612 views |
  • submit to reddit

When you look around Amazon for book reviews, you notice that some users are consistently harsher than others. For example, some users never give five stars. This observation goes the other way around too. Some users are so generous with stars that the worst they would ever give is three out of five even if the review itself is a litany of complaints. Let’s call them Harsh and Generous, respectively.

And there is another group of users that we might conflate with Harsh and Generous: Lazy. Lazy users do not put much effort into rating books. They just pick an arbitrary rating because they have an extrinsic motivation (ex: getting something for free by cranking out reviews). If lazy users decide to always rate books at 5/10 or 10/10, they might appear harsh or generous although they are just lazy in reality.

Defining Harsh, Generous and Lazy

Take a look at this graph:

Based on this graph, let’s define Harsh, Generous and Laxy as follows:

  • Generous: Always gives 9 or higher.
  • Harsh: Always gives 5 or lower.
  • Lazy: Always gives the same rating and has rated more than 5 times.

The “more than 5 times” condition for the Lazy is intended to filter out infrequent reviewers (Hence, the Lazy is not so lazy after all — at least they submit a lot of reviews!)

Query 1: Counting Harsh, Generous and Lazy

Result     :
+-------------+-----+
| rating_type | cnt |
+-------------+-----+
| Generous    | 137 |
| Harsh       | 64  |
| Lazy        | 137 |
+-------------+-----+

There are 105283 users that have rated at least one book, so, Generous/Harsh/Lazy all account for ~0.1% of the users.

A closer look at the Lazy

Let’s look at the distribution of lazy users.

Query 2: Distribution of lazy users.

Result     :
+-------------+-----+
| book_rating | cnt |
+-------------+-----+
| 5.0         | 53  |
| 6.0         | 1   |
| 7.0         | 3   |
| 8.0         | 8   |
| 9.0         | 4   |
| 10.0        | 68  |
+-------------+-----+

Interestingly, lazy users prefer to give 5 (the middle rating in this 1-10 scale) or 10 (the maximum) to any other numbers.

Notes on the Harsh and the Generous

To wrap up this entry, I will give a few remarks about the Harsh and the Generous. Here is a question: which books are affected the most by the Harsh and the Generous?

Query 3 & 4 answer this question. Because the original definition of the Harsh and the Generous had very few samples, we relaxed the definitions to “those who rate 6 or lower” and “those who rate 8 or higher.” Those Hive queries are pretty hairy, but it goes to show how much analysis you can actually do just in HiveQL. Those queries list books that are 20 books most impacted by the Generous and the Harsh, respectively.

Top 20 impacted by the Generous

Top 20 impacted by the Harsh

What’s intriguing is that the two lists do not overlap at all. The lack of overlap suggests that the Harsh and the Generous might be attracted to different types of books. Finding out which feature effectively separates the Harsh from the Generous can bring insights to both authors and publishers.

Published at DZone with permission of Sadayuki Furuhashi, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)