Probabilistic Matrix Factorization
A comparative study of PMF & Bayesian MF on MovieLens
- 1// Probabilistic Matrix Factorization
- 2export const project = {
- 3 status: "completed",
- 4 timeline: "2025",
- 5 role: "Solo: research & implementation",
- 6 language: "Python",
- 7 stack: [
- 8 "Python",
- 9 "NumPy",
- 10 "Bayesian Inference",
- 11 "Gibbs Sampling",
- 12 "MovieLens",
- 13 ],
- 14};
BPMF reaches 0.9087 RMSE on MovieLens 100K, beating the strongest baseline by 0.034, with gains concentrated where profiles are sparsest.
- 5 factorization models + 4 baselines
- 51 passing tests, finite-difference-checked gradients
- Linear training-cost scaling verified empirically
Overview
A rigorous comparative study of probabilistic and Bayesian matrix factorization for recommendation. Each user and item carries a latent vector; an observed rating is a noisy inner product, and with Gaussian priors the MAP objective reduces to regularized squared error where the regularization strength is a ratio of variances, which is the sense in which the factorization is 'probabilistic'. The Bayesian extension (BPMF) replaces fixed prior variances with Gaussian–Wishart hyperpriors and integrates by Gibbs sampling.
BPMF is the strongest model at 0.9087 test RMSE on MovieLens 100K, 0.0341 ahead of the best non-factorization baseline, and its advantage concentrates in sparse-profile users, exactly where the hierarchical prior should help. The ordering is preserved at ten times the data (1M), and training cost is shown to scale linearly in the number of observed entries. The repo ships 51 passing tests with finite-difference-checked gradients.
Key features
- PMF, PMF+biases, logistic link, Adam, and BPMF
- Ablations on capacity, regularization & optimizer
- Error stratified by user activity
- MovieLens 100K & 1M with confidence intervals
Notes
Demonstrates the ability to run a careful, honest empirical study (the metric that matters, controlled ablations and confidence intervals), not just train a model.
From-scratch MAP and Bayesian (Gibbs-sampled) matrix factorization with variance-ratio regularization, plus a scaling analysis of training cost.
A reproducible pipeline with a tested code base, an IEEE-style report, and an interactive results page tying every number back to a real run.