From 585117917eae58f10e0e31b944372d2179fad03b Mon Sep 17 00:00:00 2001 From: Louise Bowler Date: Fri, 2 Nov 2018 14:54:37 +0000 Subject: [PATCH 1/4] Link Binder badge directly to the demo. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c98f71..78f5990 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ + # BOCPDMS: Bayesian On-line Changepoint Detection with Model Selection -[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/alan-turing-institute/bocpdms/master) +[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/alan-turing-institute/bocpdms/master?filepath=examples%2FNile.ipynb) This repository contains code from the _Bayesian On-line Changepoint Detection with Model Selection_ project. From 30a47f0526def75a8ee757a99204a57eba10d565 Mon Sep 17 00:00:00 2001 From: Louise Bowler Date: Fri, 2 Nov 2018 16:10:42 +0000 Subject: [PATCH 2/4] Add how to run from command line, contributors, note about robust/reproducible and fix toc links. --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78f5990..dd6a77d 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,9 @@ This repository contains code from the _Bayesian On-line Changepoint Detection w ## Table of contents * [About BOCPDMS](#about-bocpdms) -* [Citing this project](#citing-this-project) +* [Reproducible Research Champions](#reproducible-research-champions) * [Installation instructions](#installation-instructions) * [Running the examples](#running-the-examples) -* [Reproducible research champions program](#reproducible-research-champions-program) -* [Contributors](#contributors) ## About BOCPDMS @@ -31,6 +29,12 @@ Bayesian On-line Changepoint Detection (BOCPD) is a discrete-time inference fram ²Jeremias Knoblauch, Jack Jewson and Theodoros Damoulas. [Doubly Robust Bayesian Inference for Non-Stationary Streaming Data with β-Divergences](https://arxiv.org/abs/1806.02261), arXiv:1806.02261 (2018). +### Code + +The code in this repository was used in both papers, and we are currently working on splitting the two projects so that it is easier to reproduce the work in both the older¹ and newer² papers. You can track our progress on this in [issue \#14](https://github.com/alan-turing-institute/bocpdms/issues/14). + +Until we close \#14, you may notice that the results from some of the examples are _robust_, but do not exactly _reproduce_ those from the ICML paper. This is due to changes in the core classes, and in particular the hyperparameter optimisation process, between the publication of the two papers. + ## Reproducible Research Champions In May 2018, Theo Damoulas was selected as one of the Alan Turing Institute's Reproducible Research Champions - academics who encourage and promote reproducible research through their own work, and who want to take their latest project to the "next level" of reproducibility. @@ -130,3 +134,32 @@ tests\test_nile_example.py . [100%] ========================== 6 passed in 17.83 seconds ========================== ``` + + +## Running the examples + +You can jump directly to an interactive demo of the Nile example by clicking on this Binder button: +[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/alan-turing-institute/bocpdms/master?filepath=examples%2FNile.ipynb) + +To run from the command line, first activate your virtual environment as described above. You can then run, for example, +``` +python nile_ICML18.py +``` +and +``` +python paper_pictures_nileData.py +``` +to generate the figure(s). Recently we have started to add further options that let you change various parameters from the command line. These are currently available for the Nile river height and bee waggle dance examples (although you can find this functionality for some of the other scripts in their respective [branches](https://github.com/alan-turing-institute/bocpdms/branches)). You can see the various options with the following commands: +``` +python nile_ICML18.py --help +python bee_waggle_ICML18.py --help +``` + +## Contributors + +Thank you to the following for their contributions to this project: +- Jeremias Knoblauch +- Theo Damoulas +- Kirstie Whitaker +- Martin O'Reilly +- Louise Bowler From e3b1b5da2403df67102f52d055396f87181c6422 Mon Sep 17 00:00:00 2001 From: Louise Bowler Date: Fri, 2 Nov 2018 16:11:10 +0000 Subject: [PATCH 3/4] Fix typo in command line args help. --- nile_ICML18.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nile_ICML18.py b/nile_ICML18.py index 4cafc4d..dc1f416 100644 --- a/nile_ICML18.py +++ b/nile_ICML18.py @@ -61,12 +61,12 @@ def load_nile_data(path_to_data): nile_file = os.path.join(baseline_working_directory, "Data", "nile.txt") T, S1, S2, river_height, __, __ = load_nile_data(nile_file) # Use standardised river height - """STEP 2: Set up initial hyperparameters (will be optimized throughout + """STEP 2: Set up initial hyperparameters (will be optimized throughout the algorithm) and lag lengths""" # Set up the parser parser = argparse.ArgumentParser( - description="Options for applying the BOCPDMS algorithm to the bee waggle dance dataset.") + description="Options for applying the BOCPDMS algorithm to the Nile river height dataset.") parser.add_argument("-a", "--prior_a", type=float, default=1.0, help="Initial value of a") parser.add_argument("-b", "--prior_b", type=float, default=1.0, help="Initial value of b") parser.add_argument("-ms", "--prior_mean_scale", type=float, default=0.0, @@ -111,8 +111,8 @@ def load_nile_data(path_to_data): model_universe = np.array(AR_models) model_prior = np.array([1 / len(model_universe)] * len(model_universe)) - """STEP 5: Build and run detector, i.e. the object responsible for executing - BOCPDMS with multiple (previously specified) models for the segments and a + """STEP 5: Build and run detector, i.e. the object responsible for executing + BOCPDMS with multiple (previously specified) models for the segments and a CP model specified by cp_model""" detector = Detector( data=river_height, @@ -152,7 +152,7 @@ def load_nile_data(path_to_data): format="pdf", dpi=800) plt.cla() - """STEP 8: Also plot some performance indicators (will usually be printed + """STEP 8: Also plot some performance indicators (will usually be printed to the console before the plots)""" print("\nCPs are ", detector.CPs[-2]) print("\n***** Predictive MSE + NLL from Table 1 in ICML 2018 paper *****") From 7b2eb69ba50081917f03b6a28fb0e20c5eded45c Mon Sep 17 00:00:00 2001 From: Louise Bowler Date: Fri, 2 Nov 2018 17:25:09 +0000 Subject: [PATCH 4/4] Add link to reproducible Fig 5 Binder demo. --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dd6a77d..e519d97 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # BOCPDMS: Bayesian On-line Changepoint Detection with Model Selection [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/alan-turing-institute/bocpdms/master?filepath=examples%2FNile.ipynb) @@ -11,6 +10,7 @@ This repository contains code from the _Bayesian On-line Changepoint Detection w * [Reproducible Research Champions](#reproducible-research-champions) * [Installation instructions](#installation-instructions) * [Running the examples](#running-the-examples) +* [Contributors](#contributors) ## About BOCPDMS @@ -33,7 +33,9 @@ Bayesian On-line Changepoint Detection (BOCPD) is a discrete-time inference fram The code in this repository was used in both papers, and we are currently working on splitting the two projects so that it is easier to reproduce the work in both the older¹ and newer² papers. You can track our progress on this in [issue \#14](https://github.com/alan-turing-institute/bocpdms/issues/14). -Until we close \#14, you may notice that the results from some of the examples are _robust_, but do not exactly _reproduce_ those from the ICML paper. This is due to changes in the core classes, and in particular the hyperparameter optimisation process, between the publication of the two papers. +Until we close \#14, you may notice that the results from some of the examples are _robust_, but do not exactly _reproduce_ those from the earlier ICML paper. This is due to changes in the core classes, and in particular the hyperparameter optimisation process, between the publication of the two papers. + +Want a preview of the ICML results? Take a look at the updated demo in the branch associated with issue \#14 on Binder: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/alan-turing-institute/bocpdms/feature/14-remove-nips?filepath=examples%2FNile.ipynb) ## Reproducible Research Champions @@ -149,7 +151,7 @@ and ``` python paper_pictures_nileData.py ``` -to generate the figure(s). Recently we have started to add further options that let you change various parameters from the command line. These are currently available for the Nile river height and bee waggle dance examples (although you can find this functionality for some of the other scripts in their respective [branches](https://github.com/alan-turing-institute/bocpdms/branches)). You can see the various options with the following commands: +to generate the figure(s). Recently, we have started to add further options that let you change various parameters from the command line. These are currently available for the Nile river height and bee waggle dance examples (although you can find this functionality for some of the other scripts in their respective [branches](https://github.com/alan-turing-institute/bocpdms/branches)). You can see the various options with the following commands: ``` python nile_ICML18.py --help python bee_waggle_ICML18.py --help