BayesNet
Bayesian Network Classifiers library
Using the Library
Using Conan Package Manager
You can use the library with the Conan package manager. In your project you need to add the following files:
conanfile.txt
[requires]
bayesnet/1.1.2
[generators]
CMakeDeps
CMakeToolchain
CMakeLists.txt
Include the following lines in your CMakeLists.txt
file:
find_package(bayesnet REQUIRED)
add_executable(myapp main.cpp)
target_link_libraries(myapp PRIVATE bayesnet::bayesnet)
Then install the dependencies and build your project:
conan install . --output-folder=build --build=missing
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
cmake --build build
Note: In the sample
folder you can find a sample application that uses the library. You can use it as a reference to create your own application.
Building and Testing
The project uses Conan for dependency management and provides convenient Makefile targets for common tasks.
Prerequisites
- Conan package manager (
pip install conan
) - CMake 3.27+
- C++17 compatible compiler
Getting the code
git clone https://github.com/doctorado-ml/bayesnet
cd bayesnet
Build Commands
Release Build
make release # Configure release build with Conan
make buildr # Build the release version
Debug Build & Tests
make debug # Configure debug build with Conan
make buildd # Build the debug version
make test # Run the tests
Coverage Analysis
make coverage # Run tests with coverage analysis
make viewcoverage # View coverage report in browser
Sample Application
Run the sample application with different datasets and models:
make sample # Run with default settings
make sample fname=tests/data/glass.arff # Use glass dataset
make sample fname=tests/data/iris.arff model=AODE # Use specific model
Available Makefile Targets
debug
- Configure debug build using Conanrelease
- Configure release build using Conanbuildd
- Build debug targetsbuildr
- Build release targetstest
- Run all tests (useopt="-s"
for verbose output)coverage
- Generate test coverage reportviewcoverage
- Open coverage report in browsersample
- Build and run sample applicationconan-create
- Create Conan packageconan-upload
- Upload package to Conan remoteconan-clean
- Clean Conan cache and build foldersclean
- Clean all build artifactsdoc
- Generate documentationdiagrams
- Generate UML diagramshelp
- Show all available targets
Models
- TAN
- KDB
- SPODE
- SPnDE
- AODE
- A2DE
- BoostAODE
- XBAODE
- BoostA2DE
- XBA2DE
With Local Discretization
- TANLd
- KDBLd
- SPODELd
- AODELd
Documentation
Manual
Coverage report
Diagrams
UML Class Diagram
Dependency Diagram
Languages
C++
94.8%
Makefile
2.1%
CMake
1.3%
Python
1%
Dockerfile
0.4%
Other
0.4%