Ricardo Montañana Gómez 7f6f49b3d0 Update project version to 1.1.1
Fix CMakeLists and different configurations to fix vcpkg build & installation
Fix sample build
Update CHANGELOG
2025-05-08 12:33:11 +02:00
2024-09-13 09:42:06 +02:00
2024-05-08 06:42:19 +00:00
2024-04-30 12:06:32 +02:00
2025-03-12 16:29:29 +01:00
2025-05-08 12:33:11 +02:00
2024-05-23 17:34:48 +00:00
2025-05-08 12:33:11 +02:00
2025-05-08 12:33:11 +02:00
2024-03-08 22:20:54 +01:00
2024-11-23 20:28:16 +01:00
2025-05-08 12:33:11 +02:00
2025-05-08 12:33:11 +02:00
2024-03-11 10:57:27 +01:00
2024-04-21 11:31:27 +02:00
2025-05-08 12:33:11 +02:00
2025-04-27 21:25:21 +02:00

logo BayesNet

C++ License: MIT Gitea Release Codacy Badge Security Rating Reliability Rating Gitea Last Commit Coverage Badge DOI

Bayesian Network Classifiers library

Setup

Using the vcpkg library

You can use the library with the vcpkg library manager. In your project you have to add the following files:

vcpkg.json

{
  "name": "sample-project",
  "version-string": "0.1.0",
  "dependencies": [
    "bayesnet"
  ]
}

vcpkg-configuration.json

{
  "registries": [
    {
      "kind": "git",
      "repository": "https://github.com/rmontanana/vcpkg-stash",
      "baseline": "393efa4e74e053b6f02c4ab03738c8fe796b28e5",
      "packages": [
        "folding",
        "bayesnet",
        "arff-files",
        "fimdlp",
        "libtorch-bin"
      ]
    }
  ],
  "default-registry": {
    "kind": "git",
    "repository": "https://github.com/microsoft/vcpkg",
    "baseline": "760bfd0c8d7c89ec640aec4df89418b7c2745605"
  }
}

CMakeLists.txt

You have to include the following lines in your CMakeLists.txt file:

find_package(bayesnet CONFIG REQUIRED)

add_executable(myapp main.cpp)

target_link_libraries(myapp PRIVATE bayesnet::bayesnet)

After that, you can use the vcpkg command to install the dependencies:

vcpkg install

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.

Playing with the library

The dependencies are managed with vcpkg and supported by a private vcpkg repository in https://github.com/rmontanana/vcpkg-stash.

Getting the code

git clone https://github.com/doctorado-ml/bayesnet

Once you have the code, you can use the make command to build the project. The Makefile is used to manage the build process and it will automatically download and install the dependencies.

Release

make init # Install dependencies
make release # Build the release version
make buildr # compile and link the release version

Debug & Tests

make init # Install dependencies
make debug # Build the debug version
make test # Run the tests

Coverage

make coverage # Run the tests with coverage
make viewcoverage # View the coverage report in the browser

Sample app

After building and installing the release version, you can run the sample app with the following commands:

make sample
make sample fname=tests/data/glass.arff

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

BayesNet UML Class Diagram

Dependency Diagram

BayesNet Dependency Diagram

Description
Bayesian Network Classifiers using libtorch from scratch
Readme MIT 14 MiB
2025-07-19 20:52:59 +00:00
Languages
C++ 94.8%
Makefile 2.1%
CMake 1.3%
Python 1%
Dockerfile 0.4%
Other 0.4%