{"id":13693148,"url":"https://github.com/aimclub/BAMT","last_synced_at":"2025-05-02T21:31:51.098Z","repository":{"id":38320897,"uuid":"270748887","full_name":"aimclub/BAMT","owner":"aimclub","description":"Repository of a data modeling and analysis tool based on Bayesian networks","archived":false,"fork":false,"pushed_at":"2025-04-11T14:18:36.000Z","size":111311,"stargazers_count":126,"open_issues_count":23,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-11T14:48:09.941Z","etag":null,"topics":["bayesian-networks","mixed-data","parameters-learning","structure-learning","synthetic-data"],"latest_commit_sha":null,"homepage":"https://bamt.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimclub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-08T16:52:09.000Z","updated_at":"2025-04-11T14:18:34.000Z","dependencies_parsed_at":"2022-07-14T22:30:30.629Z","dependency_job_id":"61f4cf8e-d671-4690-829a-0766bf29970a","html_url":"https://github.com/aimclub/BAMT","commit_stats":null,"previous_names":["itmo-nss-team/bamt","itmo-nss-team/bayesian-synthetic-generator"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimclub%2FBAMT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimclub%2FBAMT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimclub%2FBAMT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimclub%2FBAMT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimclub","download_url":"https://codeload.github.com/aimclub/BAMT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252108853,"owners_count":21696149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-networks","mixed-data","parameters-learning","structure-learning","synthetic-data"],"created_at":"2024-08-02T17:01:06.235Z","updated_at":"2025-05-02T21:31:46.088Z","avatar_url":"https://github.com/aimclub.png","language":"Python","funding_links":[],"categories":["Data-driven methods"],"sub_categories":["Tabular"],"readme":"![BAMT framework logo](docs/images/BAMT_white_bg.png)\n\n# BAMT - Bayesian Analytical and Modelling Toolkit\n\nRepository of a data modeling and analysis tool based on Bayesian networks.\n\n## Badges\n\n| team       | ![ITMO](https://raw.githubusercontent.com/ITMO-NSS-team/open-source-ops/cd771018e80e9164f7b661bd2191061ab58f94de/badges/ITMO_badge.svg) ![NCCR](https://raw.githubusercontent.com/ITMO-NSS-team/open-source-ops/cd771018e80e9164f7b661bd2191061ab58f94de/badges/NCCR_badge.svg) |\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| package    | ![pypi](https://badge.fury.io/py/bamt.svg) ![Supported Python Versions](https://img.shields.io/badge/python_3.9-passing-success) ![Supported Python Versions](https://img.shields.io/badge/python_3.10-passing-success)                             |\n| tests      | ![Build](https://github.com/ITMO-NSS-team/BAMT/actions/workflows/bamtcodecov.yml/badge.svg) ![coverage](https://codecov.io/github/aimclub/BAMT/branch/master/graph/badge.svg?token=fA4qsxGqTC)                                                   |\n| docs       | ![Documentation Status](https://readthedocs.org/projects/bamt/badge/?version=latest)                                                                                                                                                              |\n| license    | ![license](https://img.shields.io/github/license/ITMO-NSS-team/BAMT)                                                                                                                                                                              |\n| stats      | ![downloads](https://static.pepy.tech/personalized-badge/bamt?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=downloads) ![downloads/month](https://static.pepy.tech/personalized-badge/bamt?period=month\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=downloads/month) ![downloads/week](https://static.pepy.tech/personalized-badge/bamt?period=week\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=downloads/week) |\n| style      | ![Black](https://img.shields.io/badge/code%20style-black-000000.svg)                                                                                                                                                                               |\n\n## Introduction\n\nBAMT - Bayesian Analytical and Modelling Toolkit. This repository contains a data modeling and analysis tool based on Bayesian networks. It can be divided into two main parts - algorithms for constructing and training Bayesian networks on data and algorithms for applying Bayesian networks for filling gaps, generating synthetic data, assessing edge strength, etc.\n\n![bamt readme scheme](docs/images/bamt_readme_scheme.png)\n\n## Installation\n\nBAMT package is available via PyPi:\n\n```bash\npip install bamt\n```\n\n## BAMT Features\n\nThe following algorithms for Bayesian Networks learning are implemented:\n\n- Building the structure of a Bayesian network based on expert knowledge by directly specifying the structure of the network.\n- Building the structure of a Bayesian network on data using three algorithms - Hill Climbing, evolutionary, and PC (PC is currently under development). For Hill Climbing, the following score functions are implemented - MI, K2, BIC, AIC. The algorithms work on both discrete and mixed data.\n- Learning the parameters of distributions in the nodes of the network based on Gaussian distribution and Mixture Gaussian distribution with automatic selection of the number of components.\n- Non-parametric learning of distributions at nodes using classification and regression models.\n- BigBraveBN - algorithm for structural learning of Bayesian networks with a large number of nodes. Tested on networks with up to 500 nodes.\n\n### Difference from existing implementations:\n\n- Algorithms work on mixed data.\n- Structural learning implements score-functions for mixed data.\n- Parametric learning implements the use of a mixture of Gaussian distributions to approximate continuous distributions.\n- Non-parametric learning of distributions with various user-specified regression and classification models.\n- The algorithm for structural training of large Bayesian networks (\u003e 10 nodes) is based on local training of small networks with their subsequent algorithmic connection.\n\n![bn example gif](img/BN_gif.gif)\n\nFor example, in terms of data analysis and modeling using Bayesian networks, a pipeline has been implemented to generate synthetic data by sampling from Bayesian networks.\n\n![synthetics generation](img/synth_gen.png)\n\n## How to use\n\nThen the necessary classes are imported from the library:\n\n```python\nfrom bamt.networks.hybrid_bn import HybridBN\n```\n\nNext, a network instance is created and training (structure and parameters) is performed:\n\n```python\nbn = HybridBN(has_logit=False, use_mixture=True)\nbn.add_edges(preprocessed_data)\nbn.fit_parameters(data)\n```\n\n## Examples \u0026 Tutorials\n\nMore examples can be found in [Documentation](https://bamt.readthedocs.io/en/latest/examples/learn_save.html).\n\n## Publications about BAMT\n\nWe have published several articles about BAMT:\n\n- [Advanced Approach for Distributions Parameters Learning in Bayesian Networks with Gaussian Mixture Models and Discriminative Models](https://www.mdpi.com/2227-7390/11/2/343) (2023)\n- [BigBraveBN: algorithm of structural learning for bayesian networks with a large number of nodes](https://www.sciencedirect.com/science/article/pii/S1877050922016945) (2022)\n- [MIxBN: Library for learning Bayesian networks from mixed data](https://www.sciencedirect.com/science/article/pii/S1877050921020925) (2021)\n- [Oil and Gas Reservoirs Parameters Analysis Using Mixed Learning of Bayesian Networks](https://link.springer.com/chapter/10.1007/978-3-030-77961-0_33) (2021)\n- [Bayesian Networks-based personal data synthesis](https://dl.acm.org/doi/abs/10.1145/3411170.3411243) (2020)\n\n## Project structure\n\nThe latest stable version of the library is available in the master branch.\n\nIt includes the following modules and directories:\n\n- [bamt](https://github.com/ITMO-NSS-team/BAMT/tree/master/bamt) - directory with the framework code:\n    - Preprocessing - module for data preprocessing\n    - Networks - module for building and training Bayesian networks\n    - Nodes - module for nodes support of Bayesian networks\n    - Utilities - module for mathematical and graph utilities\n- [data](https://github.com/ITMO-NSS-team/BAMT/tree/master/data) - directory with data for experiments and tests\n- [tests](https://github.com/ITMO-NSS-team/BAMT/tree/master/tests) - directory with unit and integration tests\n- [tutorials](https://github.com/ITMO-NSS-team/BAMT/tree/master/tutorials) - directory with tutorials\n- [docs](https://github.com/ITMO-NSS-team/BAMT/tree/master/docs) - directory with RTD documentation\n\n### Preprocessing\n\nPreprocessor module allows users to transform data according to the pipeline (similar to the pipeline in scikit-learn).\n\n### Networks\n\nThree types of networks are implemented:\n\n- HybridBN - Bayesian network with mixed data\n- DiscreteBN - Bayesian network with discrete data\n- ContinuousBN - Bayesian network with continuous data\n\nThey are inherited from the abstract class BaseNetwork.\n\n### Nodes\n\nContains classes for nodes of Bayesian networks.\n\n### Utilities\n\nUtilities module contains mathematical and graph utilities to support the main functionality of the library.\n\n## Web-BAMT\n\nA web interface for BAMT is currently under development. The repository is available at [web-BAMT](https://github.com/aimclub/Web-BAMT).\n\n## Contacts\n\nIf you have questions or suggestions, you can contact us at the following address: ideeva@itmo.ru (Irina Deeva)\n\nOur resources:\n\n- [Natural Systems Simulation Team](https://itmo-nss-team.github.io/)\n- [NSS team Telegram channel](https://t.me/NSS_group)\n- [NSS lab YouTube channel](https://www.youtube.com/@nsslab/videos)\n\n## Citation\n\n```bibtex\n@misc{BAMT,\n  author={BAMT},\n  title = {Repository experiments and data},\n  year = {2021},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/ITMO-NSS-team/BAMT.git}},\n  url = {https://github.com/ITMO-NSS-team/BAMT.git}\n}\n\n@article{deeva2023advanced,\n  title={Advanced Approach for Distributions Parameters Learning in Bayesian Networks with Gaussian Mixture Models and Discriminative Models},\n  author={Deeva, Irina and Bubnova, Anna and Kalyuzhnaya, Anna V},\n  journal={Mathematics},\n  volume={11},\n  number={2},\n  pages={343},\n  year={2023},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimclub%2FBAMT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimclub%2FBAMT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimclub%2FBAMT/lists"}