Algorithm: Make a recommendation for movies that you might like.

I need help developing an algorithm for movie recommendations.

Each user of the system evaluates films with a score of 1-100.

Tables consist of:

Table Movies ID Name Year Rating Runtime Table Con_MoviesToGenres MovieID GenreID Table Con_MovieToUser MovieID UserID Grade 

I am trying to build a SELECT query to return the 5 most recommended films for a specific movie.

Whereas, I want to somehow integrate similar genres, top grades and movie ratings (so you need to recommend an R-rated movie for a PG-rated movie, unless that is recommended in any other way). In addition, if a film matches several genres, it will increase the recommendation rate.

Bonus: if the user gives a low rating to the film β†’ he will lose the ratio of recommendations.

Update: I meant one user and one header. Whenever the user enters the "movie page" - he will receive recommendations for other films that he may like.

+6
algorithm sql
source share
5 answers

If User A and User B saw 10 films, and there is a high positive correlation between their ratings (assuming they both have similar opinions about the films), you could take the movie that User B gave a high rating and recommend it to User A.

To do something like this, perhaps you could precompute an extra table that maps User X and User Y to the number of films they saw together, and Pearson's correlation between their ratings

When a user asks for a recommendation, you can use this table to find a highly correlated user, and then recommend what he saw and loved that this person does not have.

In situations where the user does not have enough ordinary users with anyone else, you can refuse the recommendation about the overall rating of the movie that the user has not seen

+2
source share

This should be done at the atomic level: compute recommendations for one OR heading at a time.

Unable to place all details in SQL query. This must be real code.

+1
source share

This may not apply to SQL, but if you like python, there are several tutorials on this topic in this article called Collective Intelligence

+1
source share

You can check out the NetFlix contest. Found an article about it here . Maybe at least give you some good ideas ...

+1
source share

All Articles