You can use pattern matching to simplify this block:
~~~
val ratings = data._1.map { case Rating(i, j, r) =>
  Rating(i - 25, j - 25, r)
}
~~~