Skip to content

FlorianWilhelm/bhm-at-scale

Repository files navigation

Bayesian Hierarchical Modelling at Scale

Accompanying source code to the blog post Finally! Bayesian Hierarchical Modelling at Scale.

NOTE: The code is GPL-2 licensed. If you require a more permissive licence, e.g. for commercial reasons, contact me to obtain a licence for your business.

Installation

In order to set up the necessary environment:

  1. create an environment bhm-at-scale with the help of conda,
    conda env create -f environment.yaml # or `environment.lock.yaml` for exact reproduction
    
  2. activate the new environment with
    conda activate bhm-at-scale
    
  3. install bhm-at-scale with:
    python setup.py install # or `develop`
    

Then take a look into the notebooks folders.

Dependency Management & Reproducibility

  1. Always keep your abstract (unpinned) dependencies updated in environment.yaml and eventually in setup.cfg if you want to ship and install your package via pip later on.
  2. Create concrete dependencies as environment.lock.yaml for the exact reproduction of your environment with:
    conda env export -n bhm-at-scale -f environment.lock.yaml
    
    For multi-OS development, consider using --no-builds during the export.
  3. Update your current environment with respect to a new environment.lock.yaml using:
    conda env update -f environment.lock.yaml --prune
    

Project Organization

β”œβ”€β”€ AUTHORS.rst             <- List of developers and maintainers.
β”œβ”€β”€ CHANGELOG.rst           <- Changelog to keep track of new features and fixes.
β”œβ”€β”€ LICENSE.txt             <- License as chosen on the command-line.
β”œβ”€β”€ README.md               <- The top-level README for developers.
β”œβ”€β”€ data
β”‚   β”œβ”€β”€ external            <- Data from third party sources.
β”‚   β”œβ”€β”€ interim             <- Intermediate data that has been transformed.
β”‚   β”œβ”€β”€ processed           <- The final, canonical data sets for modeling.
β”‚   └── raw                 <- The original, immutable data dump.
β”œβ”€β”€ docs                    <- Directory for Sphinx documentation in rst or md.
β”œβ”€β”€ environment.yaml        <- The conda environment file for reproducibility.
β”œβ”€β”€ notebooks               <- Jupyter notebooks. Naming convention is a number (for
β”‚                              ordering), the creator's initials and a description,
β”‚                              e.g. `1.0-fw-initial-data-exploration`.
β”œβ”€β”€ setup.cfg               <- Declarative configuration of your project.
β”œβ”€β”€ setup.py                <- Use `python setup.py develop` to install for development or
|                              or create a distribution with `python setup.py bdist_wheel`.
β”œβ”€β”€ src
β”‚   └── bhm_at_scale        <- Actual Python package where the main functionality goes.
β”œβ”€β”€ tests                   <- Unit tests which can be run with `py.test`.
β”œβ”€β”€ .coveragerc             <- Configuration for coverage reports of unit tests.
β”œβ”€β”€ .isort.cfg              <- Configuration for git hook that sorts imports.
└── .pre-commit-config.yaml <- Configuration of pre-commit git hooks.

Note

This project has been set up using PyScaffold 3.2.3 and the dsproject extension 0.4. For details and usage information on PyScaffold see https://pyscaffold.org/.

About

πŸͺœ Bayesian Hierarchical Models at Scale

Resources

License

Stars

Watchers

Forks

Packages

No packages published