Difference between Rescorer and UserSimilarity in Mahout
-
22-04-2021 - |
Domanda
I am implementing a user based reccomender that should work just on categories of items in order to avoid computation on useless data. To be more clear if a user is in a category page, I don't want to calculate the preferences on all the items but just on users that have reviewed something in the same category.
To do this I am thinking to implement a custom UserSimilarity to tell Mahout that an user is not similar if he has never reviewed an item in this category. I can do the same implementing a Rescorer with filtered check.
I know that the userSimilarity is used at the beginning of the algorithm to avoid to make computation on the entire set but I don't know if it is the same on the Rescorer. The Rescorer seems to me like a Post processor...I just want to avoid heavy computation. Should I use a Rescorer or a Custom UserSimilarity? How to choose between the two?
Soluzione
IDRescorer
actually plays two roles, both as a way to pre-filter items to consider, and to post-process their scores. These correspond to its methods isFiltered()
and rescore()
. What you want to do is exactly what you do with isFiltered()
. Return true for anything not in the category you are considering.