Skip to main content

Joint Probability Trees - A formalism for learning and reasoning about joint probability distributions

Project description

pyjpt — Joint Probability Trees

Joint Probability Trees

Joint Probability Trees (JPTs) are a formalism for learning and reasoning about joint probability distributions that is tractable for practical applications. JPTs support both symbolic and subsymbolic variables in a single hybrid model without relying on prior knowledge about variable dependencies or families of distributions.

JPT representations build on tree structures that partition the probability space into relevant subregions elicited from training data, rather than postulating a rigid dependency model prior to learning. Learning and inference scale linearly, and the tree structure enables white-box reasoning about any posterior probability P(Q|E), providing interpretable explanations for every inference result.

Installation

Install the core package from PyPI:

pip install pyjpt

Optional dependencies

Depending on your use case, install one or more optional dependency groups:

pip install pyjpt[matplotlib]   # matplotlib and graphviz plotting
pip install pyjpt[plotly]       # interactive plotly plotting
pip install pyjpt[seq]          # sequential/temporal models
pip install pyjpt[mlflow]       # MLflow experiment tracking

Multiple groups can be combined:

pip install pyjpt[matplotlib,mlflow]

Development setup

Clone the repository and install in editable mode with all development dependencies:

git clone https://github.com/joint-probability-trees/jpt-dev
cd jpt-dev
pip install -e ".[dev]"

By default, Cython extensions are compiled during installation. For development, you can skip pre-compilation and let pyximport handle on-the-fly compilation at runtime instead:

JPT_NO_CYTHON=1 pip install -e ".[dev]"

With on-the-fly compilation, changes to .pyx files are picked up automatically on the next import without requiring a rebuild.

Running tests

cd test
python -m unittest discover

Building distributions

python -m build            # sdist + wheel
python -m build --sdist    # source distribution only
python -m build --wheel    # wheel only

Documentation

The documentation is hosted on Read the Docs.

Building the documentation locally

Install the documentation dependencies:

pip install -r doc/requirements.txt

Then build the HTML documentation from the doc/ directory:

cd doc
make html

The output is written to doc/build/html/. Open doc/build/html/index.html in a browser to view it. The html target automatically cleans previous build artifacts before rebuilding.

Citation

If you use JPTs in your research, please cite:

@inproceedings{nyga23jpts,
    title     = {{Joint Probability Trees}},
    author    = {Daniel Nyga and Mareike Picklum and
                 Tom Schierenbeck and Michael Beetz},
    year      = {2023},
    booktitle = {arxiv.org},
    url       = {http://arxiv.org/abs/2302.07167}
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyjpt-1.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyjpt-1.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (12.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyjpt-1.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyjpt-1.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file pyjpt-1.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyjpt-1.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bf3189eabc45f8c035fdc246eed6475b8fa3fda5d0f5029ff90e1dc8e4159d98
MD5 72950cda6e9be361ec622fa924fd85ba
BLAKE2b-256 28a1a6461ea5dc76bfb23734366e93e5a8e359eaecc26d69e3673f8aef6d7049

See more details on using hashes here.

File details

Details for the file pyjpt-1.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyjpt-1.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 56e5531692faf4d6d5cd5824258073a45ca71bc5adee23ce56fd6b4595655cab
MD5 5e84a1ef7991c0af07cda535d9ec2a8f
BLAKE2b-256 dc5620fb1da237871fb4231a271a45c9265810b5df4f2db93b947920047b3148

See more details on using hashes here.

File details

Details for the file pyjpt-1.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyjpt-1.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a7ba989a966d0dee1e0d67038e70fa7c80b81a70c7b346069ad00e13ea52ec70
MD5 a9d0ab7f4f510e94eed95694f8456c72
BLAKE2b-256 e3cd1363edb785f05ccdf4daa94c3091b821c002c77c6d43aacf74e109bf7912

See more details on using hashes here.

File details

Details for the file pyjpt-1.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyjpt-1.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ac04c08d34761fc4e4f5fa64bb92416fbd59954485e57b3a30311b70b80bbb50
MD5 91eb6e15845e22eb130ccc39f5e2cd0e
BLAKE2b-256 0d1defc574ed018d8bbfc51e924b1cee37192bb2815cd8117e5f4ce3b888350d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page