I need help designing an algorithm for recommendations on movies.
Every user in the system grades movies on a score between 1-100.
Tables consist of:
Table Movies
ID Name Year Rating Runtime
Table Con_MoviesToGenres
MovieID GenreID
Table Con_MovieToUser
MovieID UserID Grade
I'm trying to build a SELECT query to return 5 most recommended movies for a specific movie.
Bearing in mind, I want to integrate in some way, similar genres, highest grades & movie Rating (so you want be recommended an R rated movie for a PG rated movie, unless it's really recommended in every other aspect). Also, if movie matches more than one genre, it will increase its recommendation ratio.
Bonus: If a user gives a low grade to a movie -> it will lose recommendation ratio.
Update: I meant for one user and one title. Whenever a user enters a "movie page" - he will get recommendations for other movies he might like.
You are late the contest is over.
But its fun.
You will have to look into some fancy math (oh I love all this)
Articles:
If User A and User B have seen 10 movies in common, and there is a high positive correlation between their ratings (implying they both have similar opinions about movies), you could then take a movie which User B has given a high rating to and recommend it to User A.
To do something like this, maybe you could precompute an extra table which maps User X and User Y to the number of movies they have seen in common and the Pearson's correlation between their ratings
When a user asks for a recommendation you could use this table to find a highly correlated user, and then recommend something he has seen and liked which this person hasn't
For situations when a user doesn't have enough common users with anybody else, you could fall back to recommending the highest rated movie overall which the user hasn't seen
This has to be done on an atomic level: calculate recommendations for one title OR user at a time.
There is no way you can fit all the details in a SQL query. This has to be done is real code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With