Weighted Matrix Factorization
Weighted matrix factorization is the standard implicit feedback adaptation of factor models: an interaction says “some preference evidence exists,” while its count or strength says how confident the system should be. It avoids treating every missing pair as a strong negative.
Preference and confidence
Hu, Koren, and Volinsky separate binary preference from confidence :
Here is the observed implicit interaction count or strength for user and item . The binary preference records whether any positive evidence exists, while confidence increases with interaction strength; controls how fast confidence grows.
The objective is
The user factor and item factor produce a preference score by dot product. The confidence term makes errors on observed, repeated interactions count more than errors on missing entries, and regularizes factor sizes.
For fixed item factors, each user update is a weighted ridge solve, closely related to ALS.
Worked example
This snippet solves a confidence-weighted user-factor update and scores all items against the learned user vector.
import numpy as np
r = np.array([3., 0., 1.])
C = np.diag(1 + 4 * r)
Y = np.array([[.8, .1], [.2, .7], [.6, .3]])
p = (r > 0).astype(float)
x = np.linalg.solve(Y.T @ C @ Y + 0.1*np.eye(2), Y.T @ C @ p)
print("user_factor", np.round(x, 3).tolist())
print("scores", np.round(Y @ x, 3).tolist())Observed output:
user_factor [1.283, 0.111]
scores [1.038, 0.335, 0.804]The item with three interactions has higher confidence and pulls the user factor most strongly. Bayesian personalized ranking instead trains pairwise orderings from positive and sampled negative items.
| Item | Interaction count | Preference | Confidence | Effect |
|---|---|---|---|---|
| 0 | 3 | 1 | 13 | Strong pull toward item 0’s factor. |
| 1 | 0 | 0 | 1 | Weak evidence; not a confident dislike. |
| 2 | 1 | 1 | 5 | Positive pull, but less than item 0. |
Caveats
The confidence formula is a modeling choice, not a fact about preference. Counts can reflect exposure, autoplay, bots, or interface placement. Tune , regularization, and negative treatment against top-k evaluation, and inspect long-tail coverage so popularity does not dominate every factor.
References
- Hu, Koren, and Volinsky, 2008, Collaborative Filtering for Implicit Feedback Datasets
- Koren, Bell, and Volinsky, 2009, Matrix Factorization Techniques for Recommender Systems
Nav