david-cortes / hpfrec

Python implementation of 'Scalable Recommendation with Hierarchical Poisson Factorization'.
http://hpfrec.readthedocs.io
BSD 2-Clause "Simplified" License
79 stars 19 forks source link

Items-items recommendation and precomputing factorization once. #7

Closed ebbandari closed 4 years ago

ebbandari commented 4 years ago

Hi David: I have a question about speed up the calculations by doing the factorizations ones. Let's assume we already have a (large) users-items matrix or data frame. Is there a way to precompute an items-items-prediction matrix where given a set of items (and their counts) that a new user inputs, then we can suggest the topN items?
For instance, if we had a items x latent_Item_Values matrix and multiplied it on the right by it's own transpose, does that matrix (or sqrt root of its elements) give us an items-items matrix? The idea is to create an items-items matrix that we can multiple with the vector of new counts from the new user and find the topN. The goal is to avoid appending the new user-items to the end of the data, and avoid factorizing the entire data again, to save some time and computation. Thanks in advance, Esfandiar

david-cortes commented 4 years ago

No, it's not possible to do it like that in closed form. Closest thing you'll get is something like predict_factors and add_user.