Function for converting the MovieLens 100K dataset to a listwise dataset.
tfrs.examples.movielens.sample_listwise(
rating_dataset: tf.data.Dataset,
num_list_per_user: int = 10,
num_examples_per_list: int = 10,
seed: Optional[int] = None
) -> tf.data.Dataset
Used in the notebooks
Used in the tutorials |
---|
Returns | |
---|---|
A tf.data.Dataset containing list examples.
Each example contains three keys: "user_id", "movie_title", and "user_rating". "user_id" maps to a string tensor that represents the user id for the example. "movie_title" maps to a tensor of shape [sum(num_example_per_list)] with dtype tf.string. It represents the list of candidate movie ids. "user_rating" maps to a tensor of shape [sum(num_example_per_list)] with dtype tf.float32. It represents the rating of each movie in the candidate list. |