diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2015-06-07 22:23:39 -0700 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2015-06-07 22:23:39 -0700 |
| commit | e5dada202c34521618bf82a086093c342841e5e8 (patch) | |
| tree | dd7c640ed2bd77ce5e6b0ae050e6662c21cc3b43 /experiments/README.txt | |
| parent | a29d738721db46b0ca3b7b5b3ffd282ad3f25909 (diff) | |
| download | criminal_cascades-e5dada202c34521618bf82a086093c342841e5e8.tar.gz | |
Project cleanup before handing it to Ben
Diffstat (limited to 'experiments/README.txt')
| -rw-r--r-- | experiments/README.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/experiments/README.txt b/experiments/README.txt new file mode 100644 index 0000000..13e0d3d --- /dev/null +++ b/experiments/README.txt @@ -0,0 +1,40 @@ +Description of the files +======================== + +* build_network.py: takes a .csv file containing a criminal network and builds + and extract a compressed binary representation tailored to make the other + scripts faster. + + Takes one argument, the name of the .csv file. The output file has the same + name but the extension .pickle + +* ml.pyx: code to compute the likelihood of a given alpha (time component) and + delta (structural component) for a given infection graph. The optimization of + the beta parameter (probability of being a root) is done internally. + +* process.py: simple loop to do an exhaustive search over a range of alpha + (time component) and delta (structural component). The likelihood (and a few + other things) for each of the values is printed in the file "out.log". + + Takes on argument the name of .pickle file computed by build_network.py + +* plot3d.py: code to obtain a 3d plot of the log likelihood as a function of + alpha and delta. Can also be easily modified to obtain 2d plots along + specific axes + +Installation +============ + +* most of the code uses standard python + numpy + matplotlib + +* the file ml.pyx is a Cython file which must be compiled in order to be used. +At a high level, ml.pyx is compiled into ml.so. The line "import ml" in +"process.py" will fail if the file ml.so is not present in the directory. +Important: do not forget to recompile ml.pyx after changing it, otherwise you +will be working with an outdated version of ml.so! + +How to compile? A Makefile is provided. If using make on MacOS is too +complicated, it is also possible to compile .pyx files using python distutils +(which I would assume is more standard on MacOS). This only requires distutils +and a simple setup.pu file. More details here: +http://docs.cython.org/src/reference/compilation.html#configuring-the-c-build |
