pgmpy_viz is an application that comes battries included with the pgmpy library. It is a package that allows user to visually model graphs via their browser. These graphs will be mapped to pgmpy models internally.
Change directory into the application
$ cd pgmpy_viz
Initialize submodule(s)
$ ./update
It is optional but suggested to start and activate a virtualenv before the steps ahead. pgmpy uses Python 3.x. So if you have multiple python installations it is suggested that you run a python 3 virtualenv before.
You may use the following steps (Linux example):
$ virtualenv -p /usr/bin/python3.2 venv
$ source venv/bin/activate
Now you can continue with installing the dependencies described ahead. ...
$ pip install -r requirements.txt
Run a local development server using the following command. The server runs on port 8000 by default.
$ python manage.py runserver
Now visit the following url in your browser:
http://localhost:8000/
You will see a blank canvas with two buttons:
- "Draw Mode"
- "Analysis Mode"
Refer wiki page for details
Use "Draw Mode" (1) to draw the model. This mode is used to add the model and post it as JSON object.
Use "Analysis Mode" (2) to analyse the graph. This mode has the functionality of observing some nodes or specific states of nodes. It also shows the CPD after observing certain nodes.
The package is currently incomplete and unstable. Kindly use with caution.