Skip to main content

BACON: Binary Aggregation Classifier for interpretable decision-making using graded logic.

Project description

BACON

** Making Agents Reason Like Humans **

In the 1970s, Jozo Dujmovic envisioned a real-valued logic system designed to reflect how people actually make decisions. He called it Graded Logic. Rather than relying on rigid true-or-false rules, it captures nuance, trade-offs, and degrees of preference during human decision processes. Building on this idea, he developed the Logic Scoring of Preference (LSP), a structured approach that enables professionals to reason through complex decisions with clarity and consistency. Over the past fifty years, these ideas have been used to support high-stakes decision making in areas such as vendor selection, medical diagnosis, and the evaluation of complex systems.

Fast forwarding to 2020s, autonomous agents and intelligent systems are increasingly making decisions on behalf of humans, often in mission-critical and safety-sensitive scenarios. Yet many of these systems operate as opaque black boxes, making it difficult to understand why a decision was made, to diagnose failures, or to ensure alignment with human values, policies, and regulatory requirements. As these systems become more capable and more widely deployed, the need for transparency, control, and trust becomes essential.

BACON brings the principles of Graded Logic and LSP into modern AI systems. It enables agents to reason in ways that reflect human thinking, to produce decisions that can be understood and explained, and to operate under meaningful human guidance. By making decision processes transparent, interpretable, and controllable, BACON helps ensure that intelligent systems are not only powerful, but also trustworthy and aligned with the people who depend on them.

Getting Started

Install BACON as a Python package:

pip install bacon-net

Then use it in your code:

import torch
from bacon.baconNet import baconNet
from bacon.visualization import print_tree_structure
from bacon.utils import generate_classic_boolean_data

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
x, y, expr_info = generate_classic_boolean_data(3, device=device)

model = baconNet(3, aggregator='bool.min_max', tree_layout='left')
model.find_best_model(x, y, x, y, max_epochs=900, save_model=False)
print_tree_structure(model.assembler, expr_info['var_names'], classic_boolean=True, layout='left')

BACON also ships with a CLI for quick demos and model tooling:

bacon demo hello-world              # run the hello-world demo
bacon demo hello-world --variables 5  # try with more variables
bacon distill model.json output.py  # distill a model to standalone code

For full documentation, visit the BACON docs or clone this repository and open docs/index.html.

Samples

Explore the samples/ directory for end-to-end examples on real datasets:

  • Hello, World! — Discover a Boolean expression from synthetic data
  • Breast Cancer — Diagnosis prediction on the UCI Breast Cancer dataset
  • Heart Disease — Prediction using the UCI Heart Disease dataset

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bacon_net-0.3.3.tar.gz (145.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bacon_net-0.3.3-py3-none-any.whl (143.5 kB view details)

Uploaded Python 3

File details

Details for the file bacon_net-0.3.3.tar.gz.

File metadata

  • Download URL: bacon_net-0.3.3.tar.gz
  • Upload date:
  • Size: 145.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for bacon_net-0.3.3.tar.gz
Algorithm Hash digest
SHA256 52d0f5fddb3ab1956308bfde49b83839e1673b7919be93410d711f1360403f0c
MD5 44668d1c33f1e695ba1f70438adad2a5
BLAKE2b-256 7c0abfe38c2329c3078244b37b1c788998671d4dd1c4885207af0cec18450149

See more details on using hashes here.

File details

Details for the file bacon_net-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: bacon_net-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 143.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for bacon_net-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51d379548474394a2f543063f5b06127d41d62584ce4907f42f01c9474486e6c
MD5 c111ed6cbabe8179ef69fc4ec1d08a54
BLAKE2b-256 4b97cc55357fc65dd8019da97ddd1bfa6b637dfb6f6fb53bf3599aa03c49d905

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page