recommenders icon indicating copy to clipboard operation
recommenders copied to clipboard

[Question] Best practice for making the model updates with new data?

Open zhoudoufu opened this issue 4 years ago • 7 comments

I have built a recommender by applying method in tutorial, but in real practice, the training data is not still, new contents will be generated, user will react to your recommendation content.

So I would like to get advice for two points:

  • What's the best practice for updating the mdl with new user behavior / new content? (Not retraining from beginning)
  • What's the best practice for involving people's reaction to my recommendation?

Thanks in advance.

zhoudoufu avatar Feb 25 '21 05:02 zhoudoufu

I'de be interested in this too. https://github.com/tensorflow/recommenders/issues/200 touches on this topic and references the GRU4Rec paper.

If we use an interaction sequence feature, would the model be able to output good recommendations if the input is an existing user id and a new interaction sequence (ex: any new interactions since the the model was trained)?

ageofneil avatar Feb 25 '21 14:02 ageofneil

  1. Incremental model training is the common practice. You keep the same model, and train it with new data every day, resuming from where the previous model left off.
  2. For including new items or new users, the following approaches are common:
    • Instead of using user ids, model users as functions of their past interactions. GRU4Rec falls in this category.
    • Use a hashing approach to have effectively dynamic vocabularies that can adapt to new item ids/other categorical features appearing in the data as the model trains.

maciejkula avatar Feb 26 '21 00:02 maciejkula

Thanks for your reply @maciejkula ~

  1. Incremental model training is the common practice. You keep the same model, and train it with new data every day, resuming from where the previous model left off.

In real practice, how to add some kind of decay on old data, making the system tends to recommend newly generated item, while keep old classic items(As in the MovieLens dataset, classic films still deserves recommending)? As the tfrs project is quite new, it's hard to find tutorials on it, some code examples will be great.

  1. For including new items or new users, the following approaches are common:

    • Instead of using user ids, model users as functions of their past interactions. GRU4Rec falls in this category.
    • Use a hashing approach to have effectively dynamic vocabularies that can adapt to new item ids/other categorical features appearing in the data as the model trains.

I will try both of these suggestion, but I don't quite get the hashing trick, Your link seems adding a hash function to the categorical encoding result,

say you have some new recommending items that are not known to the trained mdl yet, the mdl will predict the hashed item id as an output. Then how to retrieve the real item id then?

or you mean to train the mdl with these unseen items required , using hash trick to item id just helps to keep its shape unchanged?

zhoudoufu avatar Feb 26 '21 03:02 zhoudoufu

@zhoudoufu Were you able to add a decay on the old data? Could you share your solution?

alimirferdos avatar Jul 04 '21 13:07 alimirferdos

Any code example about how we

  1. load trained model
  2. and retrain on top of this model My question is basically same as https://github.com/tensorflow/recommenders/issues/384

yunruili avatar Dec 22 '21 07:12 yunruili

will try both of these suggestion, but I don't quite get the hashing trick, Your link seems adding a hash function to the categorical encoding result,

s

Could you explain more about hashing approach?

yunruili avatar Dec 24 '21 14:12 yunruili

https://arxiv.org/abs/2108.13299

yunruili avatar Dec 24 '21 15:12 yunruili