I am facing an error in “5.2 - Predictions for an existing user” of the lab notebook.
it says
error in get_user_vecs, did not find uid in user_train
UnboundLocalError Traceback (most recent call last)
in
1 uid = 2
2 # form a set of user vectors. This is the same vector, transformed and repeated.
----> 3 user_vecs, y_vecs = get_user_vecs(uid, user_train_unscaled, item_vecs, user_to_genre)
4
5 # scale our user and item vectors
~/work/recsysNN_utils.py in get_user_vecs(user_id, user_train, item_vecs, user_to_genre)
138 print(“error in get_user_vecs, did not find uid in user_train”)
139 num_items = len(item_vecs)
→ 140 user_vecs = np.tile(user_vec, (num_items, 1))
141
142 y = np.zeros(num_items)
UnboundLocalError: local variable ‘user_vec’ referenced before assignment