April 2017
Intermediate to advanced
532 pages
12h 39m
English
Looking at the results, the average rating given by a user to a movie is around 3.5, so we might expect that the distribution of ratings will be skewed towards slightly higher ratings. Let's see whether this is true, by creating a bar chart of rating values using a similar procedure as we did for occupations.
The code for plotting ratings versus count is shown here. This is available in the file CountByRatingChart.scala:
object CountByRatingChart { def main(args: Array[String]) { val customSchema = StructType(Array( StructField("user_id", IntegerType, true), StructField("movie_id", IntegerType, true), StructField("rating", IntegerType, true), StructField("timestamp", IntegerType, true))) val spConfig = (new ...Read now
Unlock full access