# ItemKNN For this approach item vectors are represented as user-frequency [num users]-dimensional vectors constructed from the user-item interaction matrix \\(U\\). \\(U_{ij}\\) indicates how many times user \\(i\\) interacted with the item \\(j\\). ### Similarity Measurement We employ cosine similarity to measure similarity between vectors: \\(score(user_i, item_j) = \cos(V_i, U^\top_j)\\) where: - \\(U\\) [num user \\(\times\\) num items]: original user-item interaction matrix - \\(V\\) [num users \\(\times\\) num users]: user embedding matrix, where each row is: \\(V_{i} = \sum_{(t, k) \in A_i} \tau^{\max_t(i) - t} U^\top_{k}\\) - \\(A_i\\): set of \\(i\\)-th user's (interaction timestamp, item index) pairs - \\(\max_t(i)\\): last \\(i\\)-th user's interaction timestamp - \\(\tau\\): time decay coefficient (per second) For instance, when \\(\tau\\) is equal to 0 (which is the simplest case), Top-k recommendations are generated by retrieving the most closest (k) item embeddings to the latest user's representation. ### Hyperparameters Parameter `hour` defines the time period (in hours) associated with a decay factor of 0.9. ### Implementation Note For 5b-scale datasets, memory constraints arise when multiplying user-item interaction matrix \\(U\\) and the user embedding matrix making computations infeasible. Thus, results for these datasets are not provided.