You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a recommender system using Bayesian Personalized Ranking and Expectation-Maximization (EM). The naive Bayes model of movie ratings is represented by the belief network shown below, with hidden variable $Z ∈ {1, 2, \dots,k}$ and partially observed binary variables $R_1, R_2,\dots, R_n$ (corresponding to movie ratings).
This model assumes that there are $k$ different types of movie-goers, and that the $i^{th}$ type of movie-goer - who represents a fraction $P(Z = i)$ of the overall population—likes the $j^{th}$ movie with conditional probability $P(R_j = 1|Z = i)$. Let $\Omega_t$ denote the set of movies seen (and hence rated) by the $t^{th}$ movie-goer. Show that the likelihood of the $t^{th}$ audience's ratings is given by
The M-step of the model is to re-estimate the probabilities $P(Z = i)$ and $P(R_j = 1|Z = i)$ that define the Conditional Probability Tables (CPT) of the belief network. As shorthand, let
We use files MovieRec_probZ_init.txt and MovieRec_probR_init.txt to initialize the probabilities $P(Z = i)$ and $P(R_j = 1|Z = i)$ for a model with $k = 4$ types of movie-goers. Run 256 iterations of the EM algorithm, computing the (normalized) log-likelihood
at each iteration. We can find the increasing log-likelihood over the iterations of optimization, indicating the fitting trend during model training.
Personalized movie recommendation
Find any audience ID in MovieRec_ids.txt to determine the row of the ratings matrix that stores their personal data. Compute the posterior probability for this row from the trained model, and then compute the expected ratings on the movies the audience hasn't yet seen: