recbole.data.customized_dataset

We only recommend building customized datasets by inheriting.

Customized datasets named [Model Name]Dataset can be automatically called.

class recbole.data.dataset.customized_dataset.DIENDataset(config)[source]

Bases: recbole.data.dataset.sequential_dataset.SequentialDataset

DIENDataset is based on SequentialDataset. It is different from SequentialDataset in data_augmentation. It add users’ negative item list to interaction.

The original version of sampling negative item list is implemented by Zhichao Feng (fzcbupt@gmail.com) in 2021/2/25, and he updated the codes in 2021/3/19. In 2021/7/9, Yupeng refactored SequentialDataset & SequentialDataLoader, then refactored DIENDataset, either.

augmentation

Whether the interactions should be augmented in RecBole.

Type

bool

seq_sample

A sampler used to sample negative item sequence.

Type

recbole.sampler.SeqSampler

neg_item_list_field

Field name for negative item sequence.

Type

str

neg_item_list

all users’ negative item history sequence.

Type

torch.tensor

data_augmentation()[source]

Augmentation processing for sequential dataset.

E.g., u1 has purchase sequence <i1, i2, i3, i4>, then after augmentation, we will generate three cases.

u1, <i1> | i2

(Which means given user_id u1 and item_seq <i1>, we need to predict the next item i2.)

The other cases are below:

u1, <i1, i2> | i3

u1, <i1, i2, i3> | i4

class recbole.data.dataset.customized_dataset.GRU4RecKGDataset(config)[source]

Bases: recbole.data.dataset.kg_seq_dataset.KGSeqDataset

class recbole.data.dataset.customized_dataset.KSRDataset(config)[source]

Bases: recbole.data.dataset.kg_seq_dataset.KGSeqDataset