OK so for those of you that are comfortable with coding I have a challenge for you.
I want you to write a Pig script that finds the most popular bad movies in our dataset, kind of a fun little
challenge here if you're not careful with coding that's OK you can just watch the answer in the next
lecture and learn from it.
So, what are we trying to do here.
Well what we want to do is first of all find all the movies and the movielens dataset that have an
average rating of less than two stars so less than 2.0 meaning it has a rating of one point something
on average.
And these are gonna be the worst of the worst right.
We saw earlier that people kind of reserve their one star ratings for some truly terrible things, so,
we're going to get some real stinkers here and then I want you to sort them by the total number of ratings.
So, we want to get the most popular bad movies in the movielens data set the, the bad movies that have
done the most damage to people's psyches in, in whole.
So this is kind of a fun little issue.
Now, we've used pretty much everything that you need from our earlier example where we actually found
good old movies.
You know we had a similar issue there of finding movies that were greater than a given rating so in
this case we just need to find movies that are less than a given rating.
But the other thing we need to do is actually get the uh, the count of ratings for each movie so we can
actually sort by that.
So the, the one new thing you need is the count command and it works just like average except that it
gives you back a count of how many things are in a bag as opposed to the average of all the things in
the bag.
So that is the one new command you'll need that we did not use in the previous example.
So again just go in and take a look at that earlier example that we use and you can use that as a starting
point for sure and go open up Ambari and go to the Pig view and start playing around see what you can
do.
So see how far you can get.
And we'll come back in the next lecture, and compare what you did to my solution.