Multiplex Link Prediction (MAGMA)

Download Code & Data

This is the data and code necessary to reproduce the results of the paper “Multiplex Graph Association Rules for Link Prediction”.

The archive contains two folders: “code” and “data”.

Code folder:

There are many important dependencies that you’ll need to satisfy in order to launch the code:

The Python dependencies are as follows:

  • You need BOTH Python 2 AND Python 3. Python 2 is only necessary to run De Bacco. If you translate De Bacco’s code to Python 3 (and make the proper adjustments to the library, which invokes the code via the subprocess command), you’ll only need Python 3.
  • You need the following Python libraries:
  • Orange
  • Numpy
  • Scipy
  • Scikit-Learn
  • Pandas
  • Networkx
  • Graph-tool

An example on how to run all algorithms is in the script “00_test.py” in the code folder.

MAGMA can take a long time to run, especially the rule scoring phase. For this reason, you can do the rule scoring in batches. Run the first time using the rule_bounds parameters to skip the scoring phase. Then re-run multiple times setting the “run” parameter to False and specifying the rule_bounds parameters to only take into account an interval of rule IDs.

Data folder:

It contains one subfolder per dataset. Each subfolder contains a file with the edgelist and the node attributes of each network. The edgelist has three tab-separated columns: source node, target node, layer. Note that the Aarhus network is undirected, so it doesn’t make a difference between source and target nodes in the edges. The node attribute file has two tab-separated columns: node id and node label. The node attribute file is necessary to run MAGMA.

The pardus folder also contains a third file: pardus_newedges. This is the edgelist (in the same format as above) containing the new edges appearing at the second observation. The other datasets are not evolving, thus if you want to reproduce the experiments results you’ll have to divide them in train-test sets using ten-fold cross validation (thus generating your own “x_newedges” file, where “x” is the name of the network file used as input).

Download Code & Data