This is the material for practical about machine learning on networks held at MLSS-2016, at Cadiz.
This tutorial has two parts
This is the code we used for the tutorial session about networks learning in MLSS-2016. The tutorial is based on the NetRate algorithm described here:
M. Gomez-Rodriguez, D. Balduzzi, B. Schölkopf. Uncovering the Temporal Dynamics of Diffusion Networks. The 28th International Conference on Machine Learning (ICML), 2011.
The generation code is written in Python 3.
The requirements for data generation are in requirements.txt
.
The script generate-graph.py
can be used to generate a graph file as well as
the solution A
matrix. Run generate-graph.py -h
to see all supported options.
The script csv2dot.sh
can be used on Unix-like systems to convert the graph
to a dot file which can be visualized using GraphViz.
The script run_cascade.py
uses the graph generated in the previous step to
generate the cascade. Run run_cascade.py -h
to see all the supported options.
The inference code, unless explicitly stated, reads the input from
cascades.csv
, assume that the time period of the cascades was 1.0
and
that there are 50
nodes in the graph.
solve_cascade.py
uses CVX to solve the NetRate problem.
solve_cascade_no_cvx.py
solves the problem using the L-BFGS-B algorithm.
utils.py
contains code which can be used to calculate the performance
of the solutions.
- cvxpy
- scipy
solve_cascade.m
uses CVX to solve the NetRate problem.
calc_score.m
defines the function which can calculate the performance.
- CVX
Here, we model recurring user activities with the help of Hawkes Processes.
All functions are provided in separate files and are self-explanatory. The main file which runs the simulation and inference is simPointProcess.m
.
- CVX
There is only one python file with one unimplemented function (sampleHawkes
)
in the file simPointProcess.py
. The file may be run in an interactive console.
- cvxpy