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.2-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.2-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.2-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.2-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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pyjpt-1.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f4a569bc3364297f77e63697025c40d416349e8a25310ff8d155100f75279d0d
MD5 15db33217772b003829b2260db27f46d
BLAKE2b-256 842eaf2afcd33f0b1e22e191a789a79e81b9bcd83d6151d49fc595ee5418b667

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyjpt-1.0.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d05080be1ca814fc6d914cf8e1f0f5b57abbd77c9a9261ccc24f0e824dc1c7ef
MD5 2423412b84207b9ada2f23be6ca90375
BLAKE2b-256 d0cfdc2d91e651f726f946c7fa8c4a43ab561a8b2c5cfc100084ce8825e556d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyjpt-1.0.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b4387cd97526536269e8565171cd58e6a9b5037ab2838886df7c7577b6720d5a
MD5 dc604f084a80a860f0279882453ae14a
BLAKE2b-256 56143c91f0efe1c3b5b211259901841c65d8890b2d5d9783f745b3f60e9079c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyjpt-1.0.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 575e6ec0116ef9e33fa2c8dc76908ce7c8c5bf8a67b71cc709f064b6daf31c0c
MD5 7c4dd1079aaf1148e6bfcf3e549dd5c7
BLAKE2b-256 b938dc7cf15afb8b644b8e54bf0283635dd047281e7f9cc6963b6a394fedfecc

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