torch_geometric.datasets.Taobao

class Taobao(root, transform: Optional[Callable] = None, pre_transform: Optional[Callable] = None)[source]

Bases: InMemoryDataset

Taobao is a dataset of user behaviors from Taobao offered by Alibaba, provided by the Tianchi Alicloud platform.

Taobao is a heterogeneous graph for recommendation. Nodes represent users with user IDs, items with item IDs, and categories with category ID. Edges between users and items represent different types of user behaviours towards items (alongside with timestamps). Edges between items and categories assign each item to its set of categories.

Parameters
  • root (str) – Root directory where the dataset should be saved.

  • transform (callable, optional) – A function/transform that takes in an torch_geometric.data.HeteroData object and returns a transformed version. The data object will be transformed before every access. (default: None)

  • pre_transform (callable, optional) – A function/transform that takes in an torch_geometric.data.HeteroData object and returns a transformed version. The data object will be transformed before being saved to disk. (default: None)