Skip to content

Latest commit

History

History
111 lines (90 loc) 路 4.56 KB

How_to_run_the_code.md

File metadata and controls

111 lines (90 loc) 路 4.56 KB

How to run the code ?

Required modules

First, install the requirements, globally (or with a virtualenv, see below):

pip install -r requirements.txt

Running some simulations

Then, it should be very straight forward to run some experiment. This will run the simulation, average them (by repetitions) and plot the results.

python main.py
# or
make main
python main.py configuration_comparing_aggregation_algorithms
# or
make comparing_aggregation_algorithms
python main.py configuration_sparse
# or
make sparse
python main.py configuration_markovian
# or
make markovian
python main_multiplayers.py
# or
make multi
python main_multiplayers_more.py
# or
make moremulti

In a virtualenv ?

If you prefer to not install the requirements globally on your system-wide Python setup, you can (and should) use virtualenv.

$ virtualenv .
Using base prefix '/usr'
New python executable in /your/path/to/AlgoBandits/bin/python3
Also creating executable in /your/path/to/AlgoBandits/bin/python
Installing setuptools, pip, wheel...done.
$ source bin/activate  # in bash, use activate.csh or activate.fish if needed
$ type pip  # just to check
pip is /your/path/to/AlgoBandits/bin/pip
$ pip install -r requirements.txt
Collecting numpy (from -r requirements.txt (line 5))
...
Installing collected packages: numpy, scipy, cycler, pytz, python-dateutil, matplotlib, joblib, pandas, seaborn, tqdm, sphinx-rtd-theme, commonmark, docutils, recommonmark
Successfully installed commonmark-0.5.4 cycler-0.10.0 docutils-0.13.1 joblib-0.11 matplotlib-2.0.0 numpy-1.12.1 pandas-0.19.2 python-dateutil-2.6.0 pytz-2016.10 recommonmark-0.4.0 scipy-0.19.0 seaborn-0.7.1 sphinx-rtd-theme-0.2.4 tqdm-4.11.2

And then be sure to use the virtualenv binary for Python, bin/python, instead of the system-wide one, to launch the experiments (the Makefile should use it by default, if source bin/activate was executed).


Or with a Makefile ?

You can also use the provided Makefile file to do this simply:

make install       # install the requirements
make multiplayers  # run and log the main.py script

It can be used to check the quality of the code with pylint:

make lint lint3  # check the code with pylint

It is also used to clean the code, build the doc, send the doc, etc.


Or within a Jupyter notebook ?

I am writing some Jupyter notebooks, in this folder (notebooks/), so if you want to do the same for your small experiments, you can be inspired by the few notebooks already written.


馃摐 License ? GitHub license

MIT Licensed (file LICENSE).

漏 2012 Olivier Capp茅, Aur茅lien Garivier, 脡milie Kaufmann and for the initial pymaBandits v1.0 project, and 漏 2016-2017 Lilian Besson for the rest.

Maintenance Ask Me Anything ! Analytics PyPI implementation PyPI pyversions ForTheBadge uses-badges ForTheBadge uses-git