Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Use git to record experiment results (as git tags) keeping the exact code that was used.

Project Description
Experimenter [![pypi](https://img.shields.io/pypi/v/experimenter.svg)](https://pypi.python.org/pypi/experimenter)
=======
Use git tags to log experiments and the exact code that was used to run those experiments. The goal is to make every experiment completely reproducible. To install use
```
pip install experimenter
```
All contributions are welcome. Experimenter was inspired by [Ali's](http://arkitus.com/patterns-for-research-in-machine-learning/) and [Charles'](http://www.theexclusive.org/2012/08/principles-of-research-code.html) blog posts.

Use Cases
-----
* It is the case that you might make some changes in your machine learning code, not necessarily worth committing, and spawn a process to run an experiment that uses these changes. However, by the time the experiment has finished you don't know what changes you were testing (presumably because you made more changes in the meanwhile).
* You need a distributed way of collecting all the experiments (parameters and results), making sure that they have been run on the exact same version of the code.

Usage
-----
Create an `ExperimentLogger` object, passing the parameters of the experiment. When the experiment is finished, call
the `record_results()` method of that object, ie:

```python
with ExperimentLogger(name="NameOfExperiment", parameters=parameters_dict) as experiment_logger:
...
experiment_logger.record_results(dict_of_results)
```

Behind the scenes, a git tag will be created (committing any changes you may have in the working tree, into a different branch). The tag will have a name of the form `exp_NameOfExperiment_timestamp` and in the message it will have a JSON representation of the parameters and the results (when/if recorded). The working state of the current branch will seemingly remain unaffected. Note that this is *not* thread-safe.

If no result is recorded (ie `record_results` is not called) within the `with` then the experiment will be deleted upon exit from that block. This is useful when stopping experiments or when experiments fail before finishing.

There is a command-line tool that helps with retrieving tests. In the git folder, run the command
```
> experimenter -c SHAofCodeState
```
to retrieve all the experiments that happened with the give code version. If `-c` is not provided then all experiments will be shown. If `-s` is provided only experiments that have results will be shown. The strict command is off by default. Use `--help` for more information.

TODO
------
* A command line tool for starting/stopping experiments.
* Auto-push tags method in `ExperimentLogger`

Release History

Release History

This version
History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
experimenter-0.1.6.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256 Source May 8, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting