recbole.data.dataloader.user_dataloader

class recbole.data.dataloader.user_dataloader.UserDataLoader(config, dataset, batch_size=1, dl_format=<InputType.POINTWISE: 1>, shuffle=False)[source]

Bases: recbole.data.dataloader.abstract_dataloader.AbstractDataLoader

UserDataLoader will return a batch of data which only contains user-id when it is iterated.

Parameters
  • config (Config) – The config of dataloader.

  • dataset (Dataset) – The dataset of dataloader.

  • batch_size (int, optional) – The batch_size of dataloader. Defaults to 1.

  • dl_format (InputType, optional) – The input type of dataloader. Defaults to POINTWISE.

  • shuffle (bool, optional) – Whether the dataloader will be shuffle after a round. Defaults to False.

shuffle

Whether the dataloader will be shuffle after a round. However, in UserDataLoader, it’s guaranteed to be True.

Type

bool

dl_type = 1
property pr_end

This property marks the end of dataloader.pr which is used in __next__().

setup()[source]

Make sure that the shuffle is True. If shuffle is False, it will be changed to True and give a warning to user.