design and steer profile likelihood fits
Project description
cabinetry
is a Python library for building and steering binned template fits.
It is written with applications in High Energy Physics in mind.
cabinetry
interfaces many other powerful libraries to make it easy for an analyzer to run their statistical inference pipeline.
Statistical models in HistFactory format can be built by cabinetry
from instructions in a declarative configuration.
cabinetry
makes heavy use of pyhf
for statistical inference, and provides additional utilities to help study and disseminate fit results.
This includes commonly used visualizations.
Due to its modular approach, analyzers are free to use all of cabinetry
's functionality or only some pieces.
cabinetry
can be used for inference and visualization with any pyhf
-compatible model, whether it was built with cabinetry
or not.
Installation
cabinetry
can be installed with pip
:
python -m pip install cabinetry
This will only install the minimum requirements for the core part of cabinetry
.
The following will install additional optional dependencies needed for ROOT
file reading:
python -m pip install cabinetry[contrib]
Hello world
To run the following example, first generate the input files via the script util/create_ntuples.py
.
import cabinetry
config = cabinetry.configuration.load("config_example.yml")
# create template histograms
cabinetry.template_builder.create_histograms(config)
# perform histogram post-processing
cabinetry.template_postprocessor.run(config)
# build a workspace
ws = cabinetry.workspace.build(config)
# run a fit
model, data = cabinetry.model_utils.model_and_data(ws)
fit_results = cabinetry.fit.fit(model, data)
# visualize the post-fit model prediction and data
model_postfit = cabinetry.model_utils.prediction(model, fit_results=fit_results)
cabinetry.visualize.data_mc(model_postfit, data, config=config)
The above is an abbreviated version of an example included in example.py
, which shows how to use cabinetry
.
It requires additional dependencies obtained with pip install cabinetry[contrib]
.
Documentation
Find more information in the documentation and tutorial material in the cabinetry-tutorials repository.
cabinetry
is also described in a paper submitted to vCHEP 2021: 10.5281/zenodo.4627037.
Acknowledgements
This work was supported by the U.S. National Science Foundation (NSF) cooperative agreement OAC-1836650 (IRIS-HEP).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cabinetry-0.3.0.tar.gz
.
File metadata
- Download URL: cabinetry-0.3.0.tar.gz
- Upload date:
- Size: 143.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df102e2f23ec309eeed1ff680a16f72ad9f565800807d02f58c7ec21971fc7c |
|
MD5 | 804799c43b6a7f608dde5a94bf306da1 |
|
BLAKE2b-256 | 787bb6fbdfbd445c8373addf749ba03197a9923f47d5dc152e5958425d484e04 |
File details
Details for the file cabinetry-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: cabinetry-0.3.0-py3-none-any.whl
- Upload date:
- Size: 63.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faeb5df05ceb9bf9a8ac508df1c39a2525c603e78f69a22b62d8a242f5a84bd6 |
|
MD5 | cd800f92360d19fb1a4cf9c32262e291 |
|
BLAKE2b-256 | 51ab021ca41e86ae0102590e0314216c48ce1245934c4fbee0191a03699d1d32 |