cgm


Namecgm JSON
Version 0.0.10 PyPI version JSON
download
home_pageNone
SummaryCausal Graphical Models
upload_time2024-06-11 23:48:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2020 Kyle Ellefsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cgm pgm dag causal inference factors
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Causal Graphical Models

[![CGM Tests](https://github.com/kyleellefsen/cgm/actions/workflows/cgm_tests.yml/badge.svg)](https://github.com/kyleellefsen/cgm/actions/workflows/cgm_tests.yml)
[![PyPi Publish](https://github.com/kyleellefsen/cgm/actions/workflows/publish_to_pypi.yml/badge.svg?event=release)](https://github.com/kyleellefsen/cgm/actions/workflows/publish_to_pypi.yml?query=event%3Arelease)
[![PyPi Version](https://img.shields.io/pypi/v/cgm)](https://pypi.org/project/cgm/)
![PyPI - Status](https://img.shields.io/pypi/status/cgm)
![PyPI - Format](https://img.shields.io/pypi/format/cgm)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/kyleellefsen/cgm/blob/master/LICENSE)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fkyleellefsen%2Fcgm%2Fmaster%2Fpyproject.toml)](https://www.python.org/)
![GitHub last commit](https://img.shields.io/github/last-commit/kyleellefsen/cgm)




A python library for building causal graphical models, closely following Daphne 
Koller's Coursera course on Probabilistic Graphical Models, and her 2009 book 
_Probabilistic Graphical Models: Principles and Techniques_. 
The source for this project is available [here][src].

## Installation
[NumPy][numpy] is the only dependency. Python version must be >= 3.7. 

    pip install cgm

## Usage

```python
import cgm

# Define all nodes
A = cgm.CG_Node('A', num_states=3)
B = cgm.CG_Node('B', 3)
C = cgm.CG_Node('C', 3)
D = cgm.CG_Node('D', 3)
# Specify all parents of nodes
cgm.CPD([B, A])
cgm.CPD([B, C])
cgm.CPD([D, A, B])
# Create causal graph
graph = cgm.CG([A, B, C, D])
print(graph)
# A ← []
# B ← [C]
# C ← []
# D ← [A, B]
```

[src]: https://github.com/kyleellefsen/cgm
[numpy]: https://numpy.org/

## Documentation
[kyleellefsen.github.io/cgm](https://kyleellefsen.github.io/cgm/)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cgm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cgm, pgm, dag, causal inference, factors",
    "author": null,
    "author_email": "Kyle Ellefsen <kyleellefsen@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/87/25/206e76aaed9a2d0a249491a545ae708d56e77e92c309642dc05024ac2cd2/cgm-0.0.10.tar.gz",
    "platform": null,
    "description": "# Causal Graphical Models\n\n[![CGM Tests](https://github.com/kyleellefsen/cgm/actions/workflows/cgm_tests.yml/badge.svg)](https://github.com/kyleellefsen/cgm/actions/workflows/cgm_tests.yml)\n[![PyPi Publish](https://github.com/kyleellefsen/cgm/actions/workflows/publish_to_pypi.yml/badge.svg?event=release)](https://github.com/kyleellefsen/cgm/actions/workflows/publish_to_pypi.yml?query=event%3Arelease)\n[![PyPi Version](https://img.shields.io/pypi/v/cgm)](https://pypi.org/project/cgm/)\n![PyPI - Status](https://img.shields.io/pypi/status/cgm)\n![PyPI - Format](https://img.shields.io/pypi/format/cgm)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/kyleellefsen/cgm/blob/master/LICENSE)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fkyleellefsen%2Fcgm%2Fmaster%2Fpyproject.toml)](https://www.python.org/)\n![GitHub last commit](https://img.shields.io/github/last-commit/kyleellefsen/cgm)\n\n\n\n\nA python library for building causal graphical models, closely following Daphne \nKoller's Coursera course on Probabilistic Graphical Models, and her 2009 book \n_Probabilistic Graphical Models: Principles and Techniques_. \nThe source for this project is available [here][src].\n\n## Installation\n[NumPy][numpy] is the only dependency. Python version must be >= 3.7. \n\n    pip install cgm\n\n## Usage\n\n```python\nimport cgm\n\n# Define all nodes\nA = cgm.CG_Node('A', num_states=3)\nB = cgm.CG_Node('B', 3)\nC = cgm.CG_Node('C', 3)\nD = cgm.CG_Node('D', 3)\n# Specify all parents of nodes\ncgm.CPD([B, A])\ncgm.CPD([B, C])\ncgm.CPD([D, A, B])\n# Create causal graph\ngraph = cgm.CG([A, B, C, D])\nprint(graph)\n# A \u2190 []\n# B \u2190 [C]\n# C \u2190 []\n# D \u2190 [A, B]\n```\n\n[src]: https://github.com/kyleellefsen/cgm\n[numpy]: https://numpy.org/\n\n## Documentation\n[kyleellefsen.github.io/cgm](https://kyleellefsen.github.io/cgm/)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2020 Kyle Ellefsen  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Causal Graphical Models",
    "version": "0.0.10",
    "project_urls": {
        "Issues": "https://github.com/kyleellefsen/cgm/issues",
        "PyPi": "https://pypi.org/project/cgm/",
        "Source": "https://github.com/kyleellefsen/cgm"
    },
    "split_keywords": [
        "cgm",
        " pgm",
        " dag",
        " causal inference",
        " factors"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2c677304bc38dd46e70791da303b75018d107c012f7bda783c47039f604593d",
                "md5": "3cff2e61ffb18102e76478818ae8046b",
                "sha256": "cf5359709154219545ec9181d32ca4a0843c400a96419bbaf41690100ddbc55d"
            },
            "downloads": -1,
            "filename": "cgm-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3cff2e61ffb18102e76478818ae8046b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19221,
            "upload_time": "2024-06-11T23:47:58",
            "upload_time_iso_8601": "2024-06-11T23:47:58.592662Z",
            "url": "https://files.pythonhosted.org/packages/d2/c6/77304bc38dd46e70791da303b75018d107c012f7bda783c47039f604593d/cgm-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8725206e76aaed9a2d0a249491a545ae708d56e77e92c309642dc05024ac2cd2",
                "md5": "14a55f94452c3c8313c0835ae99aabf1",
                "sha256": "cb1c485106522e0d66d451f14fa14730b8f293b8279dac9cba87017756c6fa83"
            },
            "downloads": -1,
            "filename": "cgm-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "14a55f94452c3c8313c0835ae99aabf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17923,
            "upload_time": "2024-06-11T23:48:00",
            "upload_time_iso_8601": "2024-06-11T23:48:00.021606Z",
            "url": "https://files.pythonhosted.org/packages/87/25/206e76aaed9a2d0a249491a545ae708d56e77e92c309642dc05024ac2cd2/cgm-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 23:48:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kyleellefsen",
    "github_project": "cgm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cgm"
}
        
Elapsed time: 2.99841s