{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "[![Build Status](https://travis-ci.com/koaning/brent.svg?branch=master)](https://travis-ci.com/koaning/brent) [![Build status](https://ci.appveyor.com/api/projects/status/aancx73nveo29esu?svg=true)](https://ci.appveyor.com/project/koaning/brent)\n\n\n![](images/logo.png)\n> They're good DAGs: brent. \n\n## What it is\n\nBrent is a small, but fun, python library that makes it easy to explore causal graphical modelling and do-calculus\non systems with discrete variables. Brent is a tool that can help out when you can write a system like below, but \nwant to write complex queries on it. \n\n![](images/dag1.png) \n\n## Quickstart \n\nYou can install brent via pip: \n\n```bash\npip install brent\n```\n\nNext we need to have a dataset and create a graph from it. \nThe code below demonstrates how to do this. \n\n```python\nfrom brent import DAG\nfrom brent.common import make_fake_df\n\ndag = (DAG(dataframe=make_fake_df(7))\n .add_edge(\"e\", \"a\")\n .add_edge(\"e\", \"d\")\n .add_edge(\"a\", \"d\")\n .add_edge(\"b\", \"d\")\n .add_edge(\"a\", \"b\")\n .add_edge(\"a\", \"c\")\n .add_edge(\"b\", \"c\")\n .add_edge(\"c\", \"f\")\n .add_edge(\"g\", \"f\"))\ndag.plot()\n```\n\n![](images/complex-graph.png)\n\nNot only do we get pretty plots, but we also can build\nan expressive query on top of it. \n\n```python\nfrom brent import Query\nq = Query(dag).given(d=1).do(a=0, c=1)\nq.plot()\n```\n\n![](images/complex-query.png)\n\nIf you're more interested in doing the inference, that's simple \ntoo. \n\n```python\n# we can also see updated probabilities\nq.infer()\nq.infer(give_table=True)\n```\n\n## Documentation\n\nLiked the quickstart? The documentation (which is generated with [pdoc3](https://github.com/pdoc3/pdoc)) can be found [here](https://koaning.github.io/brent/).\n\n## Alpha Notice \n\n**NOTE!** this project is in **preview** stages. I think I have something fun here and I've written unit tests on what I'm doing but parts are still going under review. Also there are parts of the library currently missing but which are on a roadmap: \n\n1. conditional indepdence tests \n2. api for counterfactual queries \n3. more unit tests\n4. datasets to start/teach with \n5. clear logging \n6. estimator/transformers for scikit-learn \n\n## Developing Locally \n\nAfter cloning you may install `brent` in the virtual \nenvironment via:\n\n```bash\n$ pip install -e \".[dev]\"\n```\n\nYou can generate documentation locally by running: \n\n```bash\n$ pdoc --html --overwrite --template-dir doc-settings --http 0.0.0.0:12345 brent\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "causal,bayesian,graphical,model,inference", "license": "", "maintainer": "", "maintainer_email": "", "name": "brent", "package_url": "https://pypi.org/project/brent/", "platform": "", "project_url": "https://pypi.org/project/brent/", "project_urls": null, "release_url": "https://pypi.org/project/brent/0.2.4/", "requires_dist": [ "numpy (>=1.15.4)", "scipy (>=1.2.0)", "scikit-learn (>=0.20.2)", "pandas (>=0.23.4)", "matplotlib (>=3.0.2)", "networkx (>=2.2)", "graphviz (>=0.10.1)", "flake8 (>=3.6.0) ; extra == 'dev'", "pytest (>=3.3.1) ; extra == 'dev'", "pdoc3 (>=0.5.2) ; extra == 'dev'", "nbval (>=0.9.1) ; extra == 'dev'", "plotnine (>=0.5.1) ; extra == 'dev'", "twine (>=1.13.0) ; extra == 'dev'" ], "requires_python": ">=3.6", "summary": "", "version": "0.2.4" }, "last_serial": 4946299, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "211de56e31b74a832acc3c422fb1a055", "sha256": "46e3c4f76ecabaa21dd96de15b62d0c8ca030233fe60d238eb029cdf58164de8" }, "downloads": -1, "filename": "brent-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "211de56e31b74a832acc3c422fb1a055", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13482, "upload_time": "2019-02-22T23:41:47", "url": "https://files.pythonhosted.org/packages/22/29/08f6afcd7b7e657eee0049561a674073f2aa254e5185778f2efa1d58c292/brent-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a37ad5bb292f0237b41cf2853c99048", "sha256": "4659a5f6a042b24eb71a8d76945e3eb3c865236597c051e6ecd6c76cb5e6b563" }, "downloads": -1, "filename": "brent-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4a37ad5bb292f0237b41cf2853c99048", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9950, "upload_time": "2019-02-22T23:41:50", "url": "https://files.pythonhosted.org/packages/f1/22/32899ab701e35cdc0ead9a7e6498de18899bffd708afa26c54fc7a45fc6c/brent-0.2.1.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "18a84fbf442f0992b4492e4b201ab098", "sha256": "da809dfc1e367f2d6de17b55426b30b8ff98491f1fe638b451b63011d29eb202" }, "downloads": -1, "filename": "brent-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "18a84fbf442f0992b4492e4b201ab098", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 19055, "upload_time": "2019-03-09T20:42:49", "url": "https://files.pythonhosted.org/packages/1e/a8/f726e33f83b2c11adff1ffa95cd8691651ecc8e4f6bb8dae2bf4aa166013/brent-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fdb6a4911a9a74917ef6fb2cfeaa32c", "sha256": "0a7dc180a48cb252141e7e86814c67a4b45f2a69ed1649cf13b59a352665276d" }, "downloads": -1, "filename": "brent-0.2.3.tar.gz", "has_sig": false, "md5_digest": "0fdb6a4911a9a74917ef6fb2cfeaa32c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14490, "upload_time": "2019-03-09T20:42:51", "url": "https://files.pythonhosted.org/packages/ac/15/fcfbc09956bd51fd23ee569bbbbfd689d29aca9cab50dbf300f834d7731f/brent-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "e2bc85accd20977e679a42fa5b3a42b4", "sha256": "f2cf21325b524c9a78e739c0059d8d6e944e94d4ff9a13df668fad837fb9186e" }, "downloads": -1, "filename": "brent-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e2bc85accd20977e679a42fa5b3a42b4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 19942, "upload_time": "2019-03-15T22:37:01", "url": "https://files.pythonhosted.org/packages/c1/14/9a98c480fc5ecbf7f06cdcb8e0c6bcc9d1c49d1a754fe1b7db3d24acb966/brent-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3915f832c3dc1630445f12f49ca3e39b", "sha256": "bc6e95d8db74d7723fe6cfb4bcf17847001b379f34ea5329d33366519f3faf4d" }, "downloads": -1, "filename": "brent-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3915f832c3dc1630445f12f49ca3e39b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 18365, "upload_time": "2019-03-15T22:37:02", "url": "https://files.pythonhosted.org/packages/17/7f/2ab14e09e6d7591b6814b1082cbf8a800882698cbed8474cf45ef2c8624f/brent-0.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e2bc85accd20977e679a42fa5b3a42b4", "sha256": "f2cf21325b524c9a78e739c0059d8d6e944e94d4ff9a13df668fad837fb9186e" }, "downloads": -1, "filename": "brent-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e2bc85accd20977e679a42fa5b3a42b4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 19942, "upload_time": "2019-03-15T22:37:01", "url": "https://files.pythonhosted.org/packages/c1/14/9a98c480fc5ecbf7f06cdcb8e0c6bcc9d1c49d1a754fe1b7db3d24acb966/brent-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3915f832c3dc1630445f12f49ca3e39b", "sha256": "bc6e95d8db74d7723fe6cfb4bcf17847001b379f34ea5329d33366519f3faf4d" }, "downloads": -1, "filename": "brent-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3915f832c3dc1630445f12f49ca3e39b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 18365, "upload_time": "2019-03-15T22:37:02", "url": "https://files.pythonhosted.org/packages/17/7f/2ab14e09e6d7591b6814b1082cbf8a800882698cbed8474cf45ef2c8624f/brent-0.2.4.tar.gz" } ] }