Skip to main content

dortmund2array

Tool to convert datasets from Benchmark Data Sets for Graph Kernels (K. Kersting et al., 2016) into a format suitable for deep learning research in graph classification.


Installation

Simply run pip install dortmund2array to install the command-line interface. The only dependencies are numpy networkx pandas.

Output

Given any benchmark dataset, this tool will create a file DATASET.pickle that contains a pickled list. At index i the list has a dictionary with the adjacency matrix, the graph signal (also known as graph feature matrix) and the corresponding label for the ith graph.

{
    "adjacency":    ...  # as numpy array. Shape: (nodes, nodes)
    "graph_signal": ...  # as numpy array. Shape: (nodes, features)
    "label":        ...  # usually a scalar.
}

The graph signal is an array of shape (nodes, features) where the features are either attributes given by the dataset or if no attributes are available, we simply take the node labels as attributes.

How to use

Simply get the dortmund2array command line tool via pip install dortmund2array.

usage: dortmund2array [-h] [--version] [--output OUTPUT_FOLDER]
                      [--input INPUT_FOLDER]

Tool to convert datasets from 'Benchmark Data Sets for Graph Kernels' (K.
Kersting et al., 2016)

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --output OUTPUT_FOLDER, -o OUTPUT_FOLDER
                        Output folder.
  --input INPUT_FOLDER, -i INPUT_FOLDER
                        Input folder containing the dataset of the same name.

Thus, download and unzip a dataset. Make sure the folder-name agrees with the dataset-name on the files inside of it. If you for instance download MUTAG and the corresponding folder is .\MUTAG\ and you want the array data saved in .\MUTAG_array\ then you need to simply run:

dortmund2array -i ./MUTAG/ -o ./MUTAG_array/

Requirements

Make sure you meet all the dependencies inside the requirements.txt.

Release files for dortmund2array 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dortmund2array 0.3.1
File Size Uploaded
dortmund2array-0.3.1.tar.gz 15.4 kB Details

Release files / dortmund2array-0.3.1.tar.gz

Download URL dortmund2array-0.3.1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
70ea3b3736f4f1613427e77c7d5ba11f50a2cae085e700a8e0dde7fc51ef8948
BLAKE2b-256 checksum
How to use checksums
95eecc76e88471d81449205fdb2c3a2e3f4c6f7451896fb017adbf224c6d442f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page