Skip to content

Question about Item-based KNN computation #249

@julioasotodv

Description

@julioasotodv

Hi,

I have a question regarding the Item-Item KNN implementation (as the code in lenskit.algorithms.item_knn.ItemItem pretty hard to read due to numba optims):

So, the item-item similarity matrix is computed. When predicting the rating that a user would give an specific item, the k nearest neighbors to that item are computed. But I am unsure whether the "only end up using the neighbors that the user has rated, as we do not have ratings for the rest" is computed before or after the KNN search. With this I mean: either:

  1. First, the K nearest items to the item to predict are found, and after that we filter out those that do not have been rated by the user; or
  2. First, we filter out any items that the user has not rated, and the K nearest items are computed out of only that filtered set

Some libraries implement the first option, while others do the second. Which one is implemented in Lenskit?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions