# What statistical methods are there to recommend a movie like on Netflix?

I am looking to implement a dynamic model to recommend a movie to a user. The recommendation should be updated every time the user watches a movie or rates it. To keep it simple I am thinking of taking two factors into account:

• the past ratings of other movies by the user
• the time that the user watched certain past movies

How would one setup such a model, and what does the academic literature recommend?

I am new in this field and am guessing that a linear regresion model could provide a good outcome, not to fancy around with complexer methods to avoid imposing unnecessary uncertainty in the parameter estimations. But perhaps there are already established methods that are commonly used in practice?

• I don't think this is too broad to be answerable. Eg, it has 2 upvoted answers. – gung - Reinstate Monica Dec 12 '15 at 10:22
• Try coursera's Mining Massive Datasets and its free book! – Felipe Gerard Dec 12 '15 at 15:32
• You probably want to look up matrix and/or tensor factorization. – Marc Claesen Dec 12 '15 at 18:55
• @usεr11852, the question title asks, "What statistical methods are there... ?" The last sentence asks if there are methods other than regression. I think several answers below provide this sort of information. – gung - Reinstate Monica Dec 12 '15 at 21:55

This is actually a relatively famous problem in the field of machine learning. In ~2006 Netflix offered $1m to the algorithm that provided the best reasonable improvement to their recommender system. The theory of the winning solution is briefly discussed in this Caltech textbook on introductory machine learning. Basically an ensemble learning method was used. In particular, a type of blending or stacking was employed. This is nontrivial, but kind of intuitive. To understand the intuition of using different statistical approaches in harmony, consider the different reasons different people like the same movies: i.e., Joe may like Topgun because he loves 80s action movies, while Jane likes Topgun because she likes movies with Kenny Loggins soundtracks. So the fact that both viewers watched (and rated the movie highly) doesn't necessarily mean they will like other movies with high probability. The prediction algorithm would ideally be able to accommodate these differences, at least in some capacity. This may make the solution sound pretty simple, but balancing competing algorithms and prioritizing the best guess for each case is definitely not simple. The fact that Netflix offered such a large bounty should make the magnitude of the challenge rather obvious. If you are just starting in machine learning, checking out the above resources may be helpful depending on your interest level and your maths background. So regression would probably work okay-to-good, but significantly better performance is possible. • +1 for the Netflix prize. As you pointed out, that prize is a good indicator of how massive this challenge is. – Cort Ammon Dec 12 '15 at 4:29 Half the challenge in these problems is knowing what to search for. You might have added the tag without realizing it, but you're in fact looking for info on recommender systems. You might want to start with collaborative filtering, or better yet the Introduction to Recommender Systems Handbook by Ricci, Rokach, and Shapira cited on that page. • I indeed looked deeper into the tag, and came across mostly examples on collaborative filtering. The issue that I have with that method is that it depends on other users input, if I understood the concept. I am more looking for methods in a situation of one user, no other data or optionally other data. Will have a look at your other references. – JohnAndrews Dec 12 '15 at 2:32 • @JohnAndrews: I think that ssdecontrol gives you the most relevant advice. You need to look into recommender systems literature. There are many techniques involved, eg. NNMF, Funk SVD, many different variants of nearest-neighbours classifiers, etc. to name some obvious ones. In the end you want to use collaborative filtering but you can't just "dive in" without any background. – usεr11852 Dec 12 '15 at 7:03 • @JohnAndrews CrossValidated is usually a bad place to start learning about a subject, especially if you just search by tag. How about looking at the references I linked instead? Wikipedia statistics articles aren't always reliable, but these are pretty good and cite plenty of references. – shadowtalker Dec 12 '15 at 17:37 You should check out Andrew Ng's course on Coursera: https://www.coursera.org/learn/machine-learning It has a lesson on building recommender systems, which appears to be what you're looking for. Essentially it is a form of linear regression that learns synthetic attributes for movies from people that rated films and uses that to predict recommendations for people that didn't rate/watch the films. • Welcome to our site! Thanks for including some information that summarises the contents of the link, rather than just providing a "bare" link - we appreciate it. – Silverfish Dec 12 '15 at 13:27 In the Netflix Challenge (Oct 2006 - Sep 2009) a very large ensemble (107 separate submodels) won the$1M grand prize in the end, but it is instructive to note that the first simple (non ensembled) algorithms to beat the Netflix Cinematch benchmark were based on a generalized (sparse matrix) SVD. This first milestone of beating Cinematch was achieved a mere 6 days after the competition begun by a team called WXYZConsulting.

SVD (Singular Value Decomposition) is a matrix factorization algorithm where you start with a 2d [user, movie] matrix with a rating (1 to 5 stars) in each [u, m] position (*), and break it into 3 matrices where the middle matrix is a square-matrix of latent interactions between users and movies.

You can make the square matrix rank smaller or larger to include more or less such latent factor interactions respectively.

There are several free software implementations of fast/efficient sparse SVD. For example redsvd, or vowpal-wabbit so before you write your own, you may want to try them.

(*) Most of these entries are zero, since most users haven't rated most movies. i.e. the matrix is very sparse.

References:

• What did Netflix use before? – jona Dec 22 '15 at 20:56
• An algorithm called "Cinematch" which isn't public but has been described as " linear combination of various factors refined over the years" e.g. weigthed average global rating (G) + weighted average user[u] rating + weighted average movie[m] rating, ... etc. – arielf Dec 22 '15 at 21:42
• Thanks for the elaborated answer. Will dig into it. As for the linear combinations, isnt a big problem of that over-parameterization? That would be my preferred approach. But SVD sounds promising. – JohnAndrews Dec 23 '15 at 0:10
• Not a problem if you only add factors which improve generalization error. Obviously, you need to test every such addition on unseen data to gain the necessary confidence. – arielf Dec 23 '15 at 1:27