Representation learning on temporal networks is a first step for performing further analysis, e.g. node classification. We propose TGBase that extracts key features to consider the structural characteristics of each node and its neighborhood as well as the intensity and timestamp of the interactions among node pairs.
The paper can be found here.
pandas==1.1.0
torch==1.10.0
scikit_learn==1.0.1
numpy==1.21.2
Sample datasets can be downloaded from the following sources:
- Networks with static labels:
- Cryptocurrency transaction networks: Bitcoin, Ethereum
- Rating platforms (e.g., Amazon, OTC)
- Networks with dynamic labels:
- Social networks (e.g., Wikipedia, Reddit)
To user your own data, it should have similar format to the above datasets. All data are assumed to be in "data" folder.
- Static node classification:
- To generate TGBase embedding for OTC dataset and classify the nodes with a Random Forest classifier:
python src/TGBase_staticEmb.py --network otc python src/static_n_clf.py --network otc --clf RF
- To generate TGBase embedding for OTC dataset and classify the nodes with a Random Forest classifier:
- Dynamic node classification:
- To generate embeddings for wikipedia network and apply the classification with a MLP classifier:
python src/TGBase_DynEmb.py --network wikipedia python src/dynamic_n_clf.py --network wikipedia --clf MLP
- To generate embeddings for wikipedia network and apply the classification with a MLP classifier:
An execution summary is saved in "logs" folder.
We would like to thank TGN's authors for providing open access to the implementation of their methods.
@inproceedings{tgbase_sdm_2022,
title={A Strong Node Classification Baseline for Temporal Graphs},
author={Farimah Poursafaei and Zeljko Zilic and Reihaneh Rabbany},
booktitle={SIAM International Conference on Data Mining (SIAM SDM22)},
year={2022}
}