tensorflow / tensorflow/recommenders

Question: How best to prepare a dataset for sequential recommendation.

Open
#343 8 comments 0 reactions 1 assignee View on GitHub

@maciejkula is already working on this.

Since Aug 6, 2021.

question
Dominant language
Python
Stars
2k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

Me again :)

I would like to understand how best to prepare data for a sequential recommender similar to GRU4Rec.

Our data initially can be viewed as just a bunch of sequences of variable length, one sequence per user:

seqs = [
  [a, b, a, c, d, e, d, g],
  ...
]

Now I assume we want to prepare a y or target, so the simplest approach (as I see it) is to:

  • slice off the last element of each item in seqs as the y
  • pad the seqs to a max length

But then there are many ways in which we could make different versions of this dataset, for example from seqs[0], we could actually make many rows by creating copies incrementally predicting the next item.

So my question is:

  • is there any theoretical best practice on how to prep such a dataset?
  • are there are helpers in terms of implementation to make this easier / cleaner within TFRS or a TF data pipeline?
  • edit: is there also a specific way to prepare data and formulate the problem in order to predict not the next sequence value but further ahead?

Thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.