Skip to content

Chapter 10: Content-Based Recommendation: Movies

Programs of chapter 10 of the book Data Algorithms (O'Reilly, 2015), running on Spark 4.3.0.

Sample input: data/chap10/ratings.tsv

Run the commands from the repository folder after building the jar (Running the programs).

Spark (Java)

chap10.spark.MovieRecommendations

Source: MovieRecommendations.java

scripts/run_spark.sh org.dataalgorithms.chap10.spark.MovieRecommendations data/chap10/ratings.tsv
  • Writes to movies/ in the current directory; delete it first if it exists: rm -r movies

chap10.spark.MovieRecommendationsWithJoin

Source: MovieRecommendationsWithJoin.java

scripts/run_spark.sh org.dataalgorithms.chap10.spark.MovieRecommendationsWithJoin data/chap10/ratings.tsv
  • Writes to movies/ in the current directory; delete it first if it exists: rm -r movies

Spark (Scala)

chap10.scala.MovieRecommendations

Source: MovieRecommendations.scala

scripts/run_spark.sh org.dataalgorithms.chap10.scala.MovieRecommendations data/chap10/ratings.tsv /tmp/data-algorithms/chap10.scala.MovieRecommendations/output