April 2017
Intermediate to advanced
532 pages
12h 39m
English
Let's see what the title of our chosen movie is:
println(titles(itemId))
The preceding code will print the following output:
Wes Craven's New Nightmare (1994)
As we did for user recommendations, we can sense check our item-to-item similarity computations and take a look at the titles of the most similar movies. This time, we will take the top 11, so that we can exclude our given movie. So, we will take the numbers 1 to 11 in the list:
val sortedSims2 = sims.top(K + 1)(Ordering.by[(Int, Double), Double] { case (id, similarity) => similarity }) sortedSims2.slice(1, 11).map{ case (id, sim) => (titles(id), sim) }.mkString("n")
You will see the movie titles and scores displayed similar to this output:
(Hideaway ...
Read now
Unlock full access