Algorithmadvanced
SVD++
Also called Koren SVD++.
Adds to the biased latent factor model an implicit-feedback term, a scaled sum of factors of the items the user rated or viewed, so that the fact of rating counts as a signal.
- Solves
- Recommendation problem
- Time
- O(E s d r) worst
- Space
- O((m + n) r) extra
- Where
- E = the number of epochs; d = the largest number of implicit items of one user; m = the number of users; n = the number of items; r = the number of factors; s = the number of known ratings
- Model
- Word RAM
- Properties
- randomizednot exactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Yehuda Koren, 2008
SVD++ is a latent factor model for rating prediction in which the vector of a user is the free vector of matrix factorization plus a normalized sum of item vectors over the set of items with implicit feedback from , such as the items the user rated, rented or viewed. Koren introduced it in 2008 for the Netflix Prize, where was the set of rated items: which films a user chose to rate says something about the user, apart from the values of the ratings. The model is trained by stochastic gradient descent on the regularized squared error of the known ratings.
In plain words
Plain matrix factorization learns a taste profile for each user from the ratings alone. SVD++ also uses the list of items that the user touched, even when it does not know what the user thought of them. Each item gets a second profile that says what having touched this item tells about a person. The user's full profile is the learned taste profile plus the average of these second profiles over the items the user touched.
So a user with few ratings but a long history of views still gets a useful profile, and a user's profile changes as soon as a new view enters the history, even before the model learns anything new.
The problem
The input is a set of known ratings of users for items, , and for each user a set of items with implicit feedback. In Koren's experiments is the set of items that rated, since the Netflix data had no other implicit data (Section 2.5). The model of Equation 15 predicts
with the mean rating, biases , and vectors . Write for the vector in the parentheses; the sum is 0 when is empty. With , training minimizes
with the penalties inside the sum over the ratings, as in the paper. Like plain matrix factorization, is not convex, and training finds a model with a low value, not a certified minimum.
The algorithm
FIT(K, N, r, λ_b, λ_f, γ, E, decay)- 1
μ ← the mean of the ratings in K; b_u, b_i ← 0; p_u, q_i, y_j ← small random vectors - 2
repeat E times - 3
for each (u, i) in K, in a new random order, do - 4
z ← p_u + |N(u)|^(-1/2) Σ_{j ∈ N(u)} y_j - 5
e ← r_ui - (μ + b_u + b_i + q_i·z) - 6
b_u ← b_u + γ (e - λ_b b_u); b_i ← b_i + γ (e - λ_b b_i) - 7
(q_i, p_u) ← (q_i + γ (e z - λ_f q_i), p_u + γ (e q_i - λ_f p_u)) - 8
y_j ← y_j + γ (e |N(u)|^(-1/2) q_i - λ_f y_j) for each j in N(u) ▷ the old q_i - 9
γ ← decay · γ - 10
return μ, b, p, q, y PREDICT(u, i)- 11
return μ + b_u + b_i + q_i·(p_u + |N(u)|^(-1/2) Σ_{j ∈ N(u)} y_j)
Lines L6 to L8 are the gradient steps that Koren gives for the factor part of the integrated model of Section 5, with one step size in place of his for the biases and for the vectors. For that model he reports , for the biases, for the vectors, and a decrease of the step sizes by a factor of 0.9 after each iteration. The defaults of the code on this page follow these values.
Example
Use the toy rating matrix of this group, with the items each user rated:
| 5 | 4 | - | 1 | |
| 4 | 5 | 4 | 2 | |
| 1 | 2 | 2 | 5 | |
| - | 1 | 1 | 4 |
Take one factor and the hand-set parameters , , , , and . These values are not trained; they only show how the user vector works.
| prediction | ||||
|---|---|---|---|---|
| , | 0.4 | |||
| , | 0.4 | |||
| , , after a view of | 0.8 |
In the last row, has viewed without rating it. Nothing was retrained, but entered , its vector entered the sum, and the prediction for rose. Plain matrix factorization with the same , and biases would give in both rows for , with or without the view.
Correctness
The proof in proofs/correctness.md shows the following. The term of one rating in depends only on , , , and the with . Its gradient is in , in , and in each , with the bias parts as in matrix factorization. So lines L4 to L8 make the step , with all parts at the old values, and the method is stochastic gradient descent on . When every is empty, the prediction, the objective and the steps are those of biased matrix factorization with for the biases and for the vectors. As for matrix factorization, no convergence result is claimed.
Proof: The SVD++ update is a scaled gradient step on one term of its objective and reduces to biased matrix factorizationfull
The notation is that of the page. For a user let when is not empty and otherwise, and . Then , , and for
The parameters are ; is fixed by line L1, and is part of the input. All statements are about exact arithmetic.
Lemma 1 (the gradient of one term). depends only on , , , and the with , and
Proof. The prediction uses only the listed parameters, and so do the penalties of the term. Since is linear in and in each , with and , the derivative of is in , in , in , and in each bias. The chain rule gives times these for , and the penalties add times the parameter. Item may itself be in ; then and are still two separate parameters, and the formulas hold as stated.
Theorem 2 (the step). Let be the parameters before lines L4 to L8 for the rating , and after them. Then .
Proof. Line L4 computes and line L5 computes . Line L6 sets , and the same for . Line L7 sets and with the old and , and line L8 sets with the old . By Lemma 1 these are the coordinates of , and all other coordinates of the gradient are 0, matching the parameters that the lines do not touch.
As for matrix factorization, if is drawn uniformly from , the expected step is , by linearity.
Proposition 3 (reduction to biased matrix factorization). If is empty for every user, then , is the objective of biased matrix factorization with the penalty on the biases and on the vectors, inside the sum over the ratings, and lines L4 to L8 make the step of that method, with no change to any .
Proof. With empty, and the sum is empty, so and the penalty on in is 0. Line L7 becomes and with old values, which is line L7 of matrix factorization, and line L8 has no to visit.
Proposition 4 (rotations). For an orthogonal matrix , replacing every , and by , and keeps every prediction and .
Proof. becomes by linearity, , and orthogonal matrices keep norms.
Proposition 5 (cost). One step costs , so one epoch costs , which is at most with .
Proof. Line L4 adds vectors of length , lines L5 to L7 cost , and line L8 updates vectors of length . Line L3 visits each rating once per epoch, and the random order costs .
If the ratings of one user are processed together with computed once and the updates of the added up and applied after the last rating of the user, the cost of an epoch drops to . Theorem 2 does not cover that schedule: within one user, its later steps use the old and the old , so it is a different sequence of steps. No convergence result is claimed for either schedule; is not convex.
Complexity
The model is the word RAM with real numbers of fixed size. Let .
- One step. Line L4 sums vectors of length , and line L8 updates the same vectors, so a step costs , at most .
- One epoch. , at most . All epochs cost . With the rated items, the sum is , so heavy users dominate the cost.
- Prediction. for the first item of a user, and for each further item once is stored.
- Space. biases and numbers for , and , so .
A common change to the order of the work processes all ratings of one user together, computes once and adds up the updates of the , so that an epoch costs . This is a different sequence of steps from lines L3 to L8, not the same computation.
Properties
- More signal per user. The vector uses every item in , including items without a rating, so a user with many views and few ratings gets more than alone.
- Reduces to the biased model. With all empty, SVD++ is biased matrix factorization.
- Shared item vectors. Each is learned from all users with , so a new implicit item of a known user changes at once. A new user, however, still has no , and the paper notes that SVD++ needs retraining to handle new users, unlike its Asymmetric-SVD.
- Not unique. A joint rotation of all , and by the same orthogonal matrix keeps every prediction and .
- Randomized and approximate. The result depends on the random start and the order of the ratings.
Variants and improvements
- Asymmetric-SVD. Equation 13 of the paper drops and builds the user from two normalized sums, one over the rated items weighted by the rating minus its baseline, and one over . It has fewer parameters, handles a new user as soon as the user gives feedback, and explains a prediction by the user's own past actions. It builds on the NSVD model of Paterek, which also represents a user through the items the user rated.
- The integrated model. Equation 16 adds to SVD++ the global neighborhood model of Section 3 of the paper, with learned item to item weights over the most similar items.
- Time effects. Koren's later timeSVD++ lets the biases and the user vector change over time.
- Other implicit sets. can hold purchases, clicks or views. The model then joins explicit ratings with implicit feedback.
- Factorization machines. A factorization machine with the user, the item and the normalized set as features contains the SVD++ prediction, plus further pairwise terms between the items of .
- Training by ALS. With all other parameters fixed, the block and the block have ridge regression updates as in alternating least squares. The of one user enter the same sum, so their problem does not split item by item. The paper trains all parameters by gradient steps.
When to use it
Use SVD++ for explicit ratings when the system also knows which items each user touched, and when accuracy of the rating prediction matters more than the cost of training. Koren (2008, Table 1) reports test RMSE on the Netflix data of 0.8952, 0.8924 and 0.8911 for SVD++ with 50, 100 and 200 factors, against 0.9046, 0.9025 and 0.9009 for the biased factor model and 0.9037, 0.9013 and 0.9000 for Asymmetric-SVD. These are measurements on one data set. When there are no ratings at all, only implicit data, use a model made for implicit data such as ALS for implicit feedback. When new users must be served at once, Asymmetric-SVD or a neighborhood method avoids retraining.
Pitfalls
- Cost of heavy users. A user with thousands of items in makes each of the user's steps cost thousands of vector updates. Group the steps by user, or cap .
- The wrong in line L8. The steps for and the use the value of from before line L7. Using the new value is a different step, close to the old one for small .
- Leaking the target. When is the set of rated items and the model is evaluated on held out ratings, build only from information that the system would have at prediction time. If the held out item is in only because it was rated, the evaluation tells the model which items the user chose, and the measured error can be too low.
- Penalty on . The penalty appears in the term of every rating of , so popular implicit items are penalized many times. Tune for this form.
- Empty . Skip the normalization when is empty, rather than divide by zero.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Shared helper of the recommender system pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Small rating sets for the tests of the recommender system pages.
A rating set is a dict that maps a pair (user, item) to a float rating.
Users are 0 to m - 1 and items are 0 to n - 1. No real data is used:
the tests plant a low-rank matrix from a seeded random generator, hide
some of its entries, and measure the error on the hidden entries.
"""
import math
import random
# The toy matrix of the pages: four users (rows), four items (columns).
# None marks a missing rating.
TOY = [
[5, 4, None, 1],
[4, 5, 4, 2],
[1, 2, 2, 5],
[None, 1, 1, 4],
]
def from_rows(rows):
"""Turn a list of rows (None for a missing entry) into a rating set."""
return {
(u, i): float(v)
for u, row in enumerate(rows)
for i, v in enumerate(row)
if v is not None
}
def toy():
"""The toy matrix as a rating set."""
return from_rows(TOY)
def planted(m, n, r, seed, mean=3.0, noise=0.0, rounded=False):
"""A full m by n rating set mean + P Q^T (+ noise) with rank r factors.
The factor entries are Gaussian with variance 1 / sqrt(r), so each
product p_u . q_i has variance 1. With rounded=True each rating is
rounded to the nearest integer and clipped to the scale 1 to 5.
"""
rng = random.Random(seed)
s = r ** -0.25
p = [[rng.gauss(0.0, s) for _ in range(r)] for _ in range(m)]
q = [[rng.gauss(0.0, s) for _ in range(r)] for _ in range(n)]
ratings = {}
for u in range(m):
for i in range(n):
v = mean + sum(a * b for a, b in zip(p[u], q[i]))
if noise:
v += rng.gauss(0.0, noise)
if rounded:
v = float(min(5, max(1, round(v))))
ratings[(u, i)] = v
return ratings
def split(ratings, frac, seed):
"""Hide about frac of the entries; return (train, hidden).
An entry is hidden only if its user and its item keep at least one
training entry, so each user and each item stays in the training set.
"""
rng = random.Random(seed)
keys = sorted(ratings)
rng.shuffle(keys)
left_u, left_i = {}, {}
for u, i in keys:
left_u[u] = left_u.get(u, 0) + 1
left_i[i] = left_i.get(i, 0) + 1
target = int(frac * len(keys))
hidden = {}
for u, i in keys:
if len(hidden) >= target:
break
if left_u[u] > 1 and left_i[i] > 1:
hidden[(u, i)] = ratings[(u, i)]
left_u[u] -= 1
left_i[i] -= 1
train = {k: v for k, v in ratings.items() if k not in hidden}
return train, hidden
def rmse(predict, hidden):
"""Root mean square error of predict(u, i) on the hidden entries."""
if not hidden:
raise ValueError("no hidden entries")
total = sum((predict(u, i) - v) ** 2 for (u, i), v in hidden.items())
return math.sqrt(total / len(hidden))
def global_mean(ratings):
"""The mean of all ratings."""
return sum(ratings.values()) / len(ratings)
def by_user(ratings):
"""A dict user -> {item: rating}."""
out = {}
for (u, i), v in ratings.items():
out.setdefault(u, {})[i] = v
return out
def by_item(ratings):
"""A dict item -> {user: rating}."""
out = {}
for (u, i), v in ratings.items():
out.setdefault(i, {})[u] = v
return out
svd_plus_plus.py 142 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/svd-plus-plus/. The authors are listed in prov/87CAT3.jsonl.
"""SVD++ (Koren 2008), trained by SGD.
The prediction is
mu + b_u + b_i + q_i . (p_u + |N(u)|^(-1/2) sum over j in N(u) of y_j)
where N(u) is the set of items with implicit feedback from user u (by
default the items that u rated in the training set). The objective puts
the penalties once on each rating:
J = sum over (u, i) in K of [ e_ui^2 + lb (b_u^2 + b_i^2)
+ lf (|p_u|^2 + |q_i|^2 + sum over j in N(u) of |y_j|^2) ]
One SGD step on (u, i), with e = r_ui - prediction, z = p_u + |N(u)|^(-1/2) sum y_j
and the old values on the right side, is
b_u <- b_u + g (e - lb b_u) b_i <- b_i + g (e - lb b_i)
q_i <- q_i + g (e z - lf q_i) p_u <- p_u + g (e q_i - lf p_u)
y_j <- y_j + g (e |N(u)|^(-1/2) q_i - lf y_j) for each j in N(u)
This is theta - (g / 2) times the gradient of the term of (u, i) in J.
"""
import math
import random
class Model:
def __init__(self, m, n, r, mu, implicit):
self.m, self.n, self.r, self.mu = m, n, r, mu
self.implicit = {u: sorted(set(js)) for u, js in implicit.items()}
self.bu = [0.0] * m
self.bi = [0.0] * n
self.p = [[0.0] * r for _ in range(m)]
self.q = [[0.0] * r for _ in range(n)]
self.y = [[0.0] * r for _ in range(n)]
def user_vector(self, u):
"""z_u = p_u + |N(u)|^(-1/2) times the sum of y_j over N(u)."""
z = self.p[u][:]
nu = self.implicit.get(u, [])
if nu:
s = 1.0 / math.sqrt(len(nu))
for j in nu:
yj = self.y[j]
for f in range(self.r):
z[f] += s * yj[f]
return z
def predict(self, u, i):
z = self.user_vector(u)
return self.mu + self.bu[u] + self.bi[i] + sum(a * b for a, b in zip(self.q[i], z)) # @line L11
def implicit_from(train):
"""N(u) = the items that u rated in train."""
out = {}
for u, i in train:
out.setdefault(u, []).append(i)
return out
def init(m, n, r, train, seed, implicit=None, scale=0.1):
rng = random.Random(seed)
mu = sum(train.values()) / len(train) # @line L1
model = Model(m, n, r, mu, implicit_from(train) if implicit is None else implicit)
model.p = [[rng.gauss(0.0, scale) for _ in range(r)] for _ in range(m)]
model.q = [[rng.gauss(0.0, scale) for _ in range(r)] for _ in range(n)]
model.y = [[rng.gauss(0.0, scale) for _ in range(r)] for _ in range(n)]
return model
def objective(model, train, lb, lf):
total = 0.0
for (u, i), v in train.items():
e = v - model.predict(u, i)
reg_f = sum(a * a for a in model.p[u]) + sum(b * b for b in model.q[i])
for j in model.implicit.get(u, []):
reg_f += sum(c * c for c in model.y[j])
total += e * e + lb * (model.bu[u] ** 2 + model.bi[i] ** 2) + lf * reg_f
return total
def gradient(model, train, lb, lf):
"""The exact gradient of J: (d bu, d bi, d p, d q, d y)."""
r = model.r
gbu = [0.0] * model.m
gbi = [0.0] * model.n
gp = [[0.0] * r for _ in range(model.m)]
gq = [[0.0] * r for _ in range(model.n)]
gy = [[0.0] * r for _ in range(model.n)]
for (u, i), v in train.items():
z = model.user_vector(u)
e = v - (model.mu + model.bu[u] + model.bi[i] + sum(a * b for a, b in zip(model.q[i], z)))
gbu[u] += -2.0 * e + 2.0 * lb * model.bu[u]
gbi[i] += -2.0 * e + 2.0 * lb * model.bi[i]
nu = model.implicit.get(u, [])
s = 1.0 / math.sqrt(len(nu)) if nu else 0.0
for f in range(r):
gq[i][f] += -2.0 * e * z[f] + 2.0 * lf * model.q[i][f]
gp[u][f] += -2.0 * e * model.q[i][f] + 2.0 * lf * model.p[u][f]
for j in nu:
gy[j][f] += -2.0 * e * s * model.q[i][f] + 2.0 * lf * model.y[j][f]
return gbu, gbi, gp, gq, gy
def sgd_step(model, u, i, v, lb, lf, gamma):
z = model.user_vector(u) # @line L4
e = v - (model.mu + model.bu[u] + model.bi[i] + sum(a * b for a, b in zip(model.q[i], z))) # @line L5
model.bu[u] += gamma * (e - lb * model.bu[u]) # @line L6
model.bi[i] += gamma * (e - lb * model.bi[i])
nu = model.implicit.get(u, [])
s = 1.0 / math.sqrt(len(nu)) if nu else 0.0
qi_old = model.q[i][:]
pu, qi = model.p[u], model.q[i]
for f in range(model.r):
qi[f] += gamma * (e * z[f] - lf * qi[f]) # @line L7
pu[f] += gamma * (e * qi_old[f] - lf * pu[f])
for j in nu:
yj = model.y[j]
for f in range(model.r):
yj[f] += gamma * (e * s * qi_old[f] - lf * yj[f]) # @line L8
def sgd_epoch(model, train, lb, lf, gamma, order):
for u, i in order:
sgd_step(model, u, i, train[(u, i)], lb, lf, gamma)
def fit(train, m, n, r, lb=0.005, lf=0.015, gamma=0.007, epochs=30, seed=1, implicit=None, decay=0.9):
"""Train by SGD; the step size is multiplied by decay after each epoch."""
rng = random.Random(seed)
model = init(m, n, r, train, seed, implicit)
keys = sorted(train)
for _ in range(epochs): # @line L2
rng.shuffle(keys) # @line L3
sgd_epoch(model, train, lb, lf, gamma, keys)
gamma *= decay # @line L9
return model # @line L10
test_svd_plus_plus.py 120 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/svd-plus-plus/. The authors are listed in prov/87CAT3.jsonl.
import math
import random
import recs
import svd_plus_plus as spp
H = 1e-6 # step of the central differences
TOL = 1e-6 # allowed gap, relative to max(1, |gradient entry|)
def random_model(m, n, r, train, seed, implicit=None):
rng = random.Random(seed)
model = spp.init(m, n, r, train, seed, implicit, scale=0.5)
model.bu = [rng.uniform(-0.5, 0.5) for _ in range(m)]
model.bi = [rng.uniform(-0.5, 0.5) for _ in range(n)]
return model
def params(model):
out = [(model.bu, u) for u in range(model.m)]
out += [(model.bi, i) for i in range(model.n)]
for mat in (model.p, model.q, model.y):
out += [(row, f) for row in mat for f in range(model.r)]
return out
def flat_gradient(model, train, lb, lf):
gbu, gbi, gp, gq, gy = spp.gradient(model, train, lb, lf)
out = gbu + gbi
for row in gp + gq + gy:
out += row
return out
def test_gradient_matches_central_differences():
full = recs.planted(5, 5, 2, 7, noise=0.2)
train, _ = recs.split(full, 0.3, 7)
# Implicit sets with an item the user did not rate.
implicit = spp.implicit_from(train)
implicit[0] = sorted(set(implicit[0]) | {4})
model = random_model(5, 5, 2, train, 3, implicit)
lb, lf = 0.1, 0.3
g = flat_gradient(model, train, lb, lf)
for (vec, k), gk in zip(params(model), g):
old = vec[k]
vec[k] = old + H
up = spp.objective(model, train, lb, lf)
vec[k] = old - H
down = spp.objective(model, train, lb, lf)
vec[k] = old
assert abs((up - down) / (2 * H) - gk) <= TOL * max(1.0, abs(gk))
def test_sgd_step_is_half_gradient_step_on_one_rating():
full = recs.planted(4, 5, 2, 9)
train, _ = recs.split(full, 0.3, 9)
lb, lf, gamma = 0.05, 0.1, 0.03
for (u, i), v in sorted(train.items()):
model = random_model(4, 5, 2, train, 10 * u + i)
g = flat_gradient(model, {(u, i): v}, lb, lf)
before = [vec[k] for vec, k in params(model)]
spp.sgd_step(model, u, i, v, lb, lf, gamma)
after = [vec[k] for vec, k in params(model)]
for b, a, gk in zip(before, after, g):
assert abs(a - (b - gamma / 2 * gk)) < 1e-12
def test_reduces_to_biased_factorization():
"""With every N(u) empty, SVD++ is the biased model trained the same way."""
full = recs.planted(6, 5, 2, 2, noise=0.2)
train, _ = recs.split(full, 0.3, 2)
model = random_model(6, 5, 2, train, 5, implicit={})
lam, gamma = 0.05, 0.02
twin = {"bu": model.bu[:], "bi": model.bi[:], "p": [r[:] for r in model.p], "q": [r[:] for r in model.q]}
order = sorted(train)
random.Random(1).shuffle(order)
spp.sgd_epoch(model, train, lam, lam, gamma, order)
for u, i in order: # the biased factorization step, written out
v = train[(u, i)]
e = v - (model.mu + twin["bu"][u] + twin["bi"][i] + sum(a * b for a, b in zip(twin["p"][u], twin["q"][i])))
twin["bu"][u] += gamma * (e - lam * twin["bu"][u])
twin["bi"][i] += gamma * (e - lam * twin["bi"][i])
pu, qi = twin["p"][u], twin["q"][i]
for f in range(2):
a, b = pu[f], qi[f]
pu[f] = a + gamma * (e * b - lam * a)
qi[f] = b + gamma * (e * a - lam * b)
assert all(abs(a - b) < 1e-12 for a, b in zip(model.bu, twin["bu"]))
assert all(abs(a - b) < 1e-12 for a, b in zip(model.bi, twin["bi"]))
for mat, other in ((model.p, twin["p"]), (model.q, twin["q"])):
for ra, rb in zip(mat, other):
assert all(abs(a - b) < 1e-12 for a, b in zip(ra, rb))
def test_toy_user_vector():
train = recs.toy()
model = spp.Model(4, 4, 1, 3.0, spp.implicit_from(train))
model.bu = [0.2, 0.5, -0.5, -1.0]
model.p = [[0.5], [0.5], [-0.5], [-0.5]]
model.q = [[1.0], [1.0], [1.0], [-1.0]]
model.y = [[0.4], [0.4], [0.4], [-0.4]]
assert abs(model.user_vector(0)[0] - (0.5 + 0.4 / math.sqrt(3))) < 1e-12
assert abs(model.predict(0, 2) - (3.7 + 0.4 / math.sqrt(3))) < 1e-12
assert abs(model.predict(3, 0) - (1.5 + 0.4 / math.sqrt(3))) < 1e-12
model.implicit[3] = [0, 1, 2, 3] # user 4 also viewed item 1, with no rating
assert abs(model.predict(3, 0) - 1.9) < 1e-12
def test_training_lowers_objective_and_beats_the_mean():
full = recs.planted(20, 15, 2, 6, noise=0.1)
train, hidden = recs.split(full, 0.3, 6)
lb, lf = 0.005, 0.015
start = spp.init(20, 15, 2, train, 2)
model = spp.fit(train, 20, 15, 2, lb=lb, lf=lf, gamma=0.02, epochs=150, seed=2, decay=1.0)
assert spp.objective(model, train, lb, lf) < 0.2 * spp.objective(start, train, lb, lf)
mu = recs.global_mean(train)
assert recs.rmse(model.predict, hidden) < recs.rmse(lambda u, i: mu, hidden)
History
Koren presented SVD++ at KDD 2008 in a paper that also introduced a global neighborhood model and Asymmetric-SVD, and that combined the neighborhood model and SVD++ in one integrated model. The work came out of the Netflix Prize, where his team used the binary information of which films each user rated. Koren, Bell and Volinsky (2009) describe the same normalized sum of item vectors as a way to add implicit inputs to matrix factorization.
References
- Yehuda Koren, Factorization meets the neighborhood, a multifaceted collaborative filtering model, Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2008), 426-434, Section 2.5 (implicit feedback as the binary matrix of rated and not rated), Section 4 (Asymmetric-SVD, Equation 13, and SVD++, Equation 15, with Table 1), Section 5 (the integrated model, Equation 16, its gradient steps and the values of the meta parameters)
- Yehuda Koren, Robert Bell and Chris Volinsky, Matrix factorization techniques for recommender systems, IEEE Computer 42(8), 30-37, 2009, section Additional input sources (the normalized sum of item vectors over the items with implicit preference)
- Charu C. Aggarwal, Recommender Systems, The Textbook, Springer, 2016, Chapter 3, Section 3.6 (latent factor models)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 87CAT3 Edit this page History Report an error Markdown