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
This model assumes that there are
The E-step of this model is to compute, for each audience, the posterior probability that he or she corresponds to a particular type of movie-goer.
The M-step of the model is to re-estimate the probabilities
denote the probabilities computed in the E-step of the algorithm. Also, let
We use files MovieRec_probZ_init.txt and MovieRec_probR_init.txt to initialize the probabilities
at each iteration. We can find the increasing log-likelihood over the iterations of optimization, indicating the fitting trend during model training.
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:
The sample output is a list of unseen movies sorted by their expected ratings for the selected audience.


