JODIEDataset
¶
JODIEDataset(
name: str,
base_dir: Optional[str] = None,
pre_transform: Optional[Callable] = None,
transform: Optional[Callable] = None,
)
Bases: Dataset
The temporal interaction graphs of the "JODIE: Predicting Dynamic Embedding Trajectory in Temporal Interaction Networks" paper, as PyG's
torch_geometric.datasets.JODIEDataset.
Every dataset is a single TemporalData stream of
user-item interactions sorted by time, with src the users, dst the
items (numbered after the users), t the timestamps (int64), msg
the interaction features and y the state change labels.
====================== ======== =========== ========== ========
Name #nodes #events #features #classes
====================== ======== =========== ========== ========
"wikipedia" 9,227 157,474 172 2
"mooc" 7,144 411,749 4 2
"lastfm" 1,980 1,293,103 2 1
====================== ======== =========== ========== ========
The "reddit" dataset of PyG is not available (its raw file is 2.4 GB).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the dataset, |
required |
base_dir
|
Optional[str]
|
Directory where to store dataset files. Default is
in the local directory |
None
|
pre_transform
|
Optional[Callable]
|
A function/transform applied to the |
None
|
transform
|
Optional[Callable]
|
A function/transform applied to the |
None
|
Example:
from mlx_graphs.datasets import JODIEDataset
dataset = JODIEDataset("wikipedia")
data = dataset[0]
>>> TemporalData(src=[157474], dst=[157474], t=[157474],
msg=[157474, 172], y=[157474])
train_data, val_data, test_data = data.train_val_test_split(
val_ratio=0.15, test_ratio=0.15
)
References
Source code in mlx_graphs/datasets/jodie.py
from mlx_graphs.datasets import JODIEDataset · mlx_graphs/datasets/jodie.py