consensusBN
is a Java-based library for Bayesian Network Fusion. This project allows users to combine multiple Bayesian networks into a single consensus network, leveraging the power of consensus-based modeling techniques. The project is supported by a published paper (link), titled "Efficient and accurate structural fusion of Bayesian networks."
- 🔀 Merge multiple Bayesian networks into a single consensus structure.
- 📄 Support for BIF, XML, JSON formats.
- ⚙️ Customizable fusion strategies (e.g., Union, BES).
- 🧪 Includes tests and reproducible examples.
- Java 17 or higher
- Maven 3.6 or higher
You can include consensusBN
to your Maven project by adding the following dependency to your pom.xml
:
<dependency>
<groupId>io.github.jlaborda</groupId>
<artifactId>consensusBN</artifactId>
<version>v1.0.1</version>
</dependency>
import es.uclm.i3a.simd.consensusBN.*
public class MyBNFusionApp {
public static void main(String[] args) {
// Creating list of shared nodes
ArrayList<Node> sharedNodes = new ArrayList<>();
for (int i = 0; i < numVariables; i++) {
Node node = new GraphNode("Node" + i);
sharedNodes.add(node);
}
// Setting seed
RandomUtil.getInstance().setSeed(42);
// Generating random DAGs
for (int i = 0; i < sizeRandomDags; i++) {
Dag randomDag = RandomGraph.randomDag(sharedNodes,0,50,19,19,19,true);
randomDagsList.add(randomDag);
}
// Applying ConsensusUnion
ConsensusUnion conDag = new ConsensusUnion(randomDagsList);
ConsensusBES conBES = new ConsensusBES(randomDagsList);
Graph gUnion = conDag.union();
Graph gBES = conBES.fusion();
System.out.println("Union: \n" + gUnion);
System.out.println("BES: \n" + gUnion);
}
}
Documentation will be available soon in the Documentation directory. Stay tuned for:
- API reference
- Use-case examples
- Integration tips
We welcome contributions! If you'd like to contribute to consensusBN
, please follow our Contribution Guidelines.
If you use consensusBN
in your research, please cite our publication:
@article{PUERTA2021155,
title = {Efficient and accurate structural fusion of Bayesian networks},
journal = {Information Fusion},
volume = {66},
pages = {155-169},
year = {2021},
issn = {1566-2535},
doi = {https://doi.org/10.1016/j.inffus.2020.09.003},
url = {https://www.sciencedirect.com/science/article/pii/S156625352030364X},
author = {José M. Puerta and Juan A. Aledo and José A. Gámez and Jorge D. Laborda},
keywords = {Bayesian networks, Aggregation, Fusion, Consensus, Heuristic orders}
}
This project is licensed under the MIT License - see the LICENSE file for details.
- The authors of the original paper: José Miguel Puerta, Juan Ángel Aledo, José Antonio Gámez and Jorge D. Laborda
- Tetrad project
For questions, suggestions, or feedback, please create an issue.