OK, so in this lecture, I'm going to give you an explicit exercise prompt in preparation for the next
lecture.
Ideally, you will complete this exercise before watching the next lecture so that the next lecture
will serve as the solution to the exercise.
As always, you can feel free to look at the notebook to get the data set, but avoid looking at any
code which will taint your solution.
OK, so what's the exercise?
The exercise is to build a recommendation system.
We're going to download a database of movies which includes information such as keywords, genres,
title synopsis, tagline, production companies, production countries and so forth.
You can feel free to use any or all of this information.
One key step in the exercise will be to combine all the information from a movie into a single string.
As you recall, the TF IDF Vector Racer and Count Vector Riser expect a list of strings as input where
each string is a document.
So feel free to get creative and think about how you might accomplish this.
Once you have your documents for each movie and you've transformed them using TF IDF, you're then going
to use those vectors to build a recommender.
Essentially, your recommendation engine should work like this.
We're going to assume that our query will always be an existing movie in the database.
For example, suppose that I have a user that likes the movie Scream three.
I'd like to recommend other movies to this user based on the fact that they already like this movie.
The next step would be to get the TF IDF representation for the movie screen three.
Once we have that vector, we will then compute the similarity between that vector and every other vector
in the database.
This will give us a whole list of similarities.
We will then sort by similarity and we will choose the closest matching movies.
The result should be that we prints out the top five matches for each query.
Once you have your function that does this, test it on several movies from different genres and confirms
yourself that it works.
OK, so hopefully the exercise makes sense.
Good luck, and I'll see you in the next lecture.