Facilitates automated and reproducible experimental research
Every experiment is sacredEvery experiment is greatIf an experiment is wastedGod gets quite irate
Sacred is a tool to help you configure, organize, log and reproduce experiments. It is designed to do all the tedious overhead work that you need to do around your actual experiment in order to:
Sacred achieves this through the following main mechanisms:
|Script to train an SVM on the iris dataset||The same script as a Sacred experiment|
from numpy.random import permutation from sklearn import svm, datasets C = 1.0 gamma = 0.7 iris = datasets.load_iris() perm = permutation(iris.target.size) iris.data = iris.data[perm] iris.target = iris.target[perm] clf = svm.SVC(C, 'rbf', gamma=gamma) clf.fit(iris.data[:90], iris.target[:90]) print(clf.score(iris.data[90:], iris.target[90:]))
from numpy.random import permutation from sklearn import svm, datasets from sacred import Experiment ex = Experiment('iris_rbf_svm') @ex.config def cfg(): C = 1.0 gamma = 0.7 @ex.automain def run(C, gamma): iris = datasets.load_iris() per = permutation(iris.target.size) iris.data = iris.data[per] iris.target = iris.target[per] clf = svm.SVC(C, 'rbf', gamma=gamma) clf.fit(iris.data[:90], iris.target[:90]) return clf.score(iris.data[90:], iris.target[90:])
The documentation is hosted at ReadTheDocs.
You can directly install it from the Python Package Index with pip:
pip install sacred
Or if you want to do it manually you can checkout the current version from git and install it yourself:
git clone https://github.com/IDSIA/sacred.gitcd sacredpython setup.py install
You might want to also install the numpy and the pymongo packages. They are optional dependencies but they offer some cool features:
pip install numpy, pymongo
The tests for sacred use the py.test package. You can execute them by running py.test in the sacred directory like this:
There is also a config file for tox so you can automatically run the tests for various python versions like this:
At this point there are two frontends to the database entries created by sacred (that I’m aware of). They are developed externally as separate projects.
Sacredboard is a web-based dashboard interface to the sacred runs stored in a MongoDB.
SacredBrowser is a PyQt4 application to browse the MongoDB entries created by sacred experiments. Features include custom queries, sorting of the results, access to the stored source-code, and many more. No installation is required and it can connect to a local database or over the network.
This project is released under the terms of the MIT license.
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|
|sacred-0.7.0-py2.py3-none-any.whl (75.8 kB) Copy SHA256 Checksum SHA256||3.4||Wheel||May 7, 2017|
|sacred-0.7.0.tar.gz (56.2 kB) Copy SHA256 Checksum SHA256||–||Source||May 7, 2017|