Skip to main content

Temporal Graph Benchmark with Sequential Dynamics

Project description

TGB-Seq Benchmark: Challenging Temporal GNNs with Complex Sequential Dynamics (ICLR 2025)

The TGB-Seq benchmark is designed to provide a comprehensive evaluation framework for temporal graph neural networks (GNNs), focusing on their ability to capture complex sequential dynamics.

  • TGB-Seq offers datasets curated from diverse real-world dynamic interaction systems, inherently featuring intricate sequential dynamics and fewer repeated edges.
  • TGB-Seq is available as a convenient pip package, offering seamless access to dataset downloading, negative sample generation and evaluation. We provide a quick-start example built on DyGLib, enabling easy integration.
  • TGB-Seq adopts a standardized evaluation protocol with fixed dataset splits, generating 100 negative samples per test instance and computing the MRR metric for consistent and reliable performance assessment.

Install

You can install TGB-Seq using Python package manager pip.

pip install tgb-seq

Requirements

  • Python>=3.9
  • numpy>2.0
  • pandas>=2.2.3
  • huggingface-hub>=0.26.0
  • torch>=2.5.0

Package Usage

Quick Start

Get started with TGB-Seq using this quick-start example built on DyGLib. Just follow the commands below to begin your journey with TGB-Seq! 🚀🚀🚀

pip install tgb-seq
git clone git@github.com:TGB-Seq/TGB-Seq.git
python examples/train_link_prediction.py --dataset_name GoogleLocal --model_name DyGFormer --patch_size 2 --max_input_sequence_length 64 --gpu 0 --batch_size 200 --dropout 0.1 --sample_neighbor_strategy recent

To submit your results to the TGB-Seq leaderboard, please fill in this Google Form.

Dataloader

For example, to load the Flickr dataset to ./data/, run the following code:

from tgb_seq.LinkPred.dataloader import TGBSeqLoader
data=TGBSeqLoader("Flickr", "./data/")

Then, Flickr.csv and Flickr_test_ns.npy will be downloaded from Hugging Face automatically into ./data/Flickr/. The arrays of source nodes, destination nodes, interaction times, negative destination nodes for the test set can be accessed as follows.

src_node_ids=data.src_node_ids
dst_node_ids=data.dst_node_ids
node_interact_times=data.node_interact_times
test_negative_samples=data.negative_samples

If you encounter any network errors when connecting to Hugging Face, you can use the Hugging Face mirror site to download the dataset. To do so, run the following command in your terminal:

export HF_ENDPOINT=https://hf-mirror.com

We also provide all the TGB-Seq datasets on Google Drive and their original datasets here.

Evaluator

Up to now, all the TGB-Seq datasets are evaluated by the MRR metric. The evaluator takes positive_probabilities with size as (batch_size,) and negative_probabilities with size as (batch_size x number_of_negatives) as inputs and outputs the rank of eash positive sample with size as (batch_size).

from tgb_seq.LinkPred.evaluator import Evaluator 
evaluator=Evaluator()
result_dict=evaluator.eval(positive_probabilities,negative_probabilities)

Citing TGB-Seq

If you use TGB-Seq datasets, please cite our paper.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgb_seq-0.1.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgb_seq-0.1.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file tgb_seq-0.1.2.tar.gz.

File metadata

  • Download URL: tgb_seq-0.1.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for tgb_seq-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fc19a32a4f56e803dcc5e83f4ec18e957d342cfa4574c606f4c4e4c8fa678ca6
MD5 c3adf2541235d2a9fa69c0ee75f267ac
BLAKE2b-256 cfc762b63f7d829c413c6ef50d273964953b0008f526d3b5c7e33dfb7fd5ecfb

See more details on using hashes here.

File details

Details for the file tgb_seq-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tgb_seq-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for tgb_seq-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15a55fbb7a1c25a206241375e48c5eb2186a5b4296ebbb5102a3d66c93fb19de
MD5 18e77af79609f649b9b57114fad5d12a
BLAKE2b-256 16ee40e16fccc52496e52b9d9b00d673adadd52945b981be06b5e22a52f5602b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page