Hi Steve,
The _ notation can be a bit confusing when starting with Scala, we can
rewrite it to avoid using it here. So instead of
val numUsers = ratings.map(_._2.user) we can write val numUsers =
ratings.map(x => x._2.user)
ratings is an Key-Value RDD (which is an RDD comprised of tuples) and so
ratings is an RDD of Rating objects. You can see them created as the
second element of the tuple. It's a simple case class:
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/recommendation/ALS.scala#L66
This is just accessing the user and product field of the