cgm


Namecgm JSON
Version 0.0.9 PyPI version JSON
download
home_pageNone
SummaryCausal Graphical Models
upload_time2024-03-21 22:26:06
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 numpy as np
import cgm

np.random.seed(30)
# 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(child=B, parents=[A])
cgm.CPD(C, [B])
cgm.CPD(D, [A, B])
# Create causal graph
graph = cgm.CG([A, B, C, D])
```

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

            

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/c3/8d/b65bfdfd8654b05eabce89767ed335cee618240355737703a81c851f6b20/cgm-0.0.9.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 numpy as np\nimport cgm\n\nnp.random.seed(30)\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(child=B, parents=[A])\ncgm.CPD(C, [B])\ncgm.CPD(D, [A, B])\n# Create causal graph\ngraph = cgm.CG([A, B, C, D])\n```\n\n[src]: https://github.com/kyleellefsen/cgm\n[numpy]: https://numpy.org/\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.9",
    "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": "156650d49d94b4bfa306f706ae940afdc4d545a240c0b0f4f257d3cc373b9f30",
                "md5": "6158aa6ca6d6a9390109987a4676e59e",
                "sha256": "da7dae9c0a96ac1a724f6b769b63e2214101d7d1e1d6ae82f6d99e1a154c159c"
            },
            "downloads": -1,
            "filename": "cgm-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6158aa6ca6d6a9390109987a4676e59e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12010,
            "upload_time": "2024-03-21T22:26:04",
            "upload_time_iso_8601": "2024-03-21T22:26:04.929666Z",
            "url": "https://files.pythonhosted.org/packages/15/66/50d49d94b4bfa306f706ae940afdc4d545a240c0b0f4f257d3cc373b9f30/cgm-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c38db65bfdfd8654b05eabce89767ed335cee618240355737703a81c851f6b20",
                "md5": "c35a3a06bde80d45013457be5fdabfbf",
                "sha256": "691387cc8acfe3ff7da167d9a4de37b3fc2025fbe79be9bf7210e98ce8c27ab6"
            },
            "downloads": -1,
            "filename": "cgm-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "c35a3a06bde80d45013457be5fdabfbf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13852,
            "upload_time": "2024-03-21T22:26:06",
            "upload_time_iso_8601": "2024-03-21T22:26:06.980002Z",
            "url": "https://files.pythonhosted.org/packages/c3/8d/b65bfdfd8654b05eabce89767ed335cee618240355737703a81c851f6b20/cgm-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-21 22:26:06",
    "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: 0.20009s