Package: bamt
packagetestsdocslicensestatsRepository of a data modeling and analysis tool based on Bayesian networksBAMT - 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 edges strength e.t.c.InstallationBAMT package is available via PyPi:pipinstallbamtBAMT FeaturesThe following algorithms for Bayesian Networks learning are implemented:Building the structure of a Bayesian network based on expert knowledge by directly specifying the structure of the network;Building the structure of a Bayesian network on data using three algorithms - Hill Climbing, evolutionary and PC (evolutionary and PC are 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.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.Non-parametric learning of distributions at nodes using classification and regression models.BigBraveBN - algorithm for structural learning of Bayesian networks with a large number of nodes. Tested on networks with up to 500 nodes.Difference from existing implementations:Algorithms work on mixed data;Structural learning implements score-functions for mixed data;Parametric learning implements the use of a mixture of Gaussian distributions to approximate continuous distributions;Non-parametric learning of distributions with various user-specified regression and classification models;The algorithm for structural training of large Bayesian networks (> 10 nodes) is based on local training of small networks with their subsequent algorithmic connection.For 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.How to useThen the necessary classes are imported from the library:importbamt.networksasNetsNext, a network instance is created and training (structure and parameters) is performed:bn=Nets.HybridBN(has_logit=False,use_mixture=True)bn.add_edges(discretized_data,scoring_function=('K2',K2Score))bn.fit_parameters(data)Examples & TutorialsMore examples can be found intutorialsandDocumentation.Publications about BAMTWe have published several articles about BAMT:Advanced Approach for Distributions Parameters Learning in Bayesian Networks with Gaussian Mixture Models and Discriminative Models(2023)BigBraveBN: algorithm of structural learning for bayesian networks with a large number of nodes(2022)MIxBN: Library for learning Bayesian networks from mixed data(2021)Oil and Gas Reservoirs Parameters Analysis Using Mixed Learning of Bayesian Networks(2021)Bayesian Networks-based personal data synthesis(2020)Project structureThe latest stable version of the library is available in the master branch.It includes the following modules and direcotries:bamt- directory with the framework code:Preprocessing - module for data preprocessingNetworks - module for building and training Bayesian networksNodes - module for nodes support of Bayesian networksUtilities - module for mathematical and graph utilitiesdata- directory with data for experiments and teststests- directory with unit and integration teststutorials- directory with tutorialsdocs- directory with RTD documentationPreprocessingPreprocessor module allows user to transform data according pipeline (similar to pipeline in scikit-learn).NetworksThree types of networks are implemented:HybridBN - Bayesian network with mixed dataDiscreteBN - Bayesian network with discrete dataContinuousBN - Bayesian network with continuous dataThey are inherited from the abstract class BaseNetwork.NodesContains classes for nodes of Bayesian networks.UtilitiesUtilities module contains mathematical and graph utilities to support the main functionality of the library.Web-BAMTA web interface for BAMT is currently under development.
The repository is available atweb-BAMTContactsIf you have questions or suggestions, you can contact us at the following address:ideeva@itmo.ru(Irina Deeva)Our resources:Natural Systems Simulation TeamNSS team Telegram channelNSS lab YouTube channel