Bilateral Trade Modelling with Graph Neural Networks
This repository contains all materials that accompanies our paper. Here we show how bilateral trade between countries can be framed as a problem of learning on graphs where we do classification of node (countries) into their various income levels (node classes). We also show that the likeliness of any two countries to trade can be predicted (link prediction). The data for our experiments were downloaded from https://comtrade.un.org.
Clone this repository.
$ git clone https://github.com/panford/BiTrade-Graphs.git $ cd BiTrade-Graphs
Install dependencies. Dependencies can be installed using either the
environments.ymlfiles. Follow any of the steps that follows to set up the environment.
$ pip install -r requirements.txt
$ conda create -f environment.yml $ conda activate bitgraph_env
Running our experiments
$ cd /path/to/BiTradeGraph/code
Preprocess the data.
$ python process_data.py
This will create a
preprocessed.npyfile in the
data/processedfolder (or a path specified by
Run code for node classification and link prediction.
$ python run_classifier.py $ python run_linkpredictor.py
Results will be saved in the
Notebooks are included to show the followed steps from data preprocessing to their use in downstream tasks.
$ jupyter notebook
Navigate to the
First run all cells in the
preprocessing.ipynbnotebook to process data. Then
This project is licensed under the MIT License.