Hello there.
I have created an exercise and I would like to hear your opinions about it.
Summary: An exercise about working with collections of key:value pairs, in the context of an information retrieval problem.
Proposal:
After some initial success with your new website, Netflow(insert random website name), you have decided to implement a recommendation system to suggest movies to users based on their preferences.
Your task consists of implementing two functions to provide the desired interface.
Filter(movie_collection,user_preferences,max_suggestions,threshold) => another_movie_collection
Rank(movie,user_preferences) => real_number
You will be given a set of movies and a user profile. You will have to return the most relevant movies according to the user profile. The rank of a movie given some preferences must be above certain relevance threshold to be recommend in order to maintain a quality standard. If a tie occurs between two or more movies you should return the one with lexicographically smaller name, in the sake of simplicity.
To calculate the score of a movie for a given user you should use a provided formula.
A movie can be represented by a collection of key value pairs.
Name:…
Producer:…
Drama:0.32
User preferences are also represented by a collection of key value pairs.
Name:…
Romance:0.10
Drama:0.25
…
The rank of a movie can calculated as the weighted average of the user preferences by the movie features.
For example:
movie[drama] * user_prefrences[drama] +…
Some concepts required:
Arithmetic
Loops
Conditionals
Dictionaries
Sorting
Custom sorting