A recommender has a collaborative-filtering embedding for every item with interaction history, but a brand-new item has none. Learn a linear map from item attributes into that embedding space on the warm items, then use it to place the new items.
Implement cold_start_embeddings(X_warm, E_warm, X_cold, lam).
Inputs
X_warm: array of shape (n, f), attribute features of the warm items.E_warm: array of shape (n, d), their learned collaborative embeddings.X_cold: array of shape (m, f), attribute features of the cold items.lam: ridge strength .Model. Append a constant 1 to every feature row so . Fit by
The last row of (the bias) is not penalized. The cold embedding is .
Output. A tuple (embeddings, nearest):
embeddings: the (m, d) predictions as a nested Python list, each value rounded to 4 decimals.nearest: a list of m ints, the index of the warm item whose embedding has the highest cosine similarity with each prediction (ties go to the lower index; a zero vector has cosine 0 with everything).