Skip to content

Commit 39ed414

Browse files
committed
Improved documentation for example scripts.
1 parent 6f0d173 commit 39ed414

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

examples/README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
This directory contains a number of example experiments, scripts and jupyter notebooks.
1+
# Examples
22

3-
For all these examples it is assumed that the dependencies in environment.yml file have been installed.
3+
This directory contains legacy examples.
44

5-
If you are running locally the easiest way to install the dependencies is by using conda to create environment.yml.
6-
7-
If you are viewing this on the web you use this [link](https://mybinder.org/v2/gh/VowpalWabbit/Coba/HEAD?filepath=examples/notebooks) to start a Jupyter environment with all dependencies installed.
5+
Many more examples can now be found in the [documentation](https://coba-docs.readthedocs.io/).

examples/scripts/Custom Vowpal.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""
2-
This is an example script that creates and executes an Experiment.
3-
This script requires that the matplotlib and vowpalwabbit packages be installed.
2+
This script creates and executes an Experiment with a custom namespace.
3+
This script requires the matplotlib and vowpalwabbit package.
44
"""
55

6-
import math
76
import coba as cb
87

98
class MakeCustomNamespaces:
@@ -17,6 +16,8 @@ def params(self):
1716
return {"target": self.target, "parts": self.partitions}
1817

1918
def filter(self, interactions):
19+
import math
20+
2021
n_parts = len(self.partitions)
2122

2223
for old in interactions:

examples/scripts/Getting Started.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
This is an example script that creates and executes an Experiment.
3-
This script depends on the matplotlib and vowpalwabbit packages.
2+
This script creates and executes an Experiment.
3+
This script requires the matplotlib and vowpalwabbit package.
44
"""
55

66
import coba as cb

examples/scripts/Logged Results.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
This script creates and executes an Experiment to generate logged data and then performs off-policy evaluation.
3+
This script requires the matplotlib and vowpalwabbit package.
4+
"""
5+
16
import coba as cb
27

38
def main():
@@ -23,6 +28,7 @@ def main():
2328
log = cb.Environments.from_result(filename)
2429
lrn = cb.VowpalLearner("--cb_explore_adf --explore_eval")
2530
val = cb.SequentialCB(learn='off',eval=False)
31+
2632
cb.Experiment(log, lrn, val).run()
2733

2834
# performance in the original online run

examples/templates/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Templates
2+
13
This directory contains two examples of environment template files.
24

35
Environment templates are a great way to share experiments with other researchers.
46

5-
These files can be loaded via Environments.from_template("short_experiment.json").
7+
Template files can be loaded via a call such as Environments.from_template("short.json").

0 commit comments

Comments
 (0)