recbole.data.dataloader.user_dataloader

class recbole.data.dataloader.user_dataloader.UserDataLoader(config, dataset, sampler, 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.

  • sampler (Sampler) – The sampler of dataloader.

  • 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

batch_size: Optional[int]
collate_fn(index)[source]

Collect the sampled index, and apply neg_sampling or other methods to get the final data.

dataset: torch.utils.data.dataset.Dataset[torch.utils.data.dataloader.T_co]
drop_last: bool
num_workers: int
pin_memory: bool
pin_memory_device: str
prefetch_factor: int
sampler: Union[torch.utils.data.sampler.Sampler, Iterable]
timeout: float