Structured Features in Naive Bayes Classification

Arthur Choi, Nazgol Tavabi, Adnan Darwiche

Introduction

The Naive Bayes (NB) classifier is a cornerstone of machine learning, prized for its simplicity, speed, and effectiveness. However, its primary limitation is the assumption that features are "simple" discrete or continuous variables. In many real-world scenarios, data is highly structured—taking the form of permutations, paths, or rankings. For instance, a ranking of 100 items involves $100!$ possible states, making traditional tabular representations computationally impossible. To bridge this gap, researchers have developed the Structured Naive Bayes (SNB).

The SNB Framework: Leveraging PSDDs

The core innovation of the SNB is the replacement of standard probability tables with Probabilistic Sentential Decision Diagrams (PSDDs). This approach allows the model to represent distributions over exponentially large state spaces compactly while maintaining linear-time efficiency for learning and classification.

The workflow of converting Boolean constraints into a PSDD using a vtree.

The construction of an SNB follows a systematic two-step process:

  1. Logical Modeling: Domain knowledge is encoded as Boolean constraints (e.g., "a node cannot be visited twice in a path"). These constraints are compiled into a Sentential Decision Diagram (SDD).
  2. Probabilistic Parameterization: The SDD is transformed into a PSDD by learning weights from observed data. This ensures the model only assigns probability mass to "legal" states defined by the logic.

Experimental Evaluation

The SNB was evaluated across several complex domains, including game traces for Tic-Tac-Toe and Hex, as well as path anomaly detection on grid graphs. Unlike specialized models like the Mallows distribution, which often assume a single "peak" of behavior, the SNB can capture multimodal distributions—such as a player who utilizes multiple distinct strategies.

Key Results

In Tic-Tac-Toe style classification, the SNB demonstrated remarkable data efficiency, reaching near-perfect accuracy after observing only 5 to 10 games. It significantly outperformed traditional models that struggled to capture the nuances of player behavior.

Classification accuracy on Tic-Tac-Toe traces as a function of observed games.

In path anomaly detection on an 8x8 grid, the SNB achieved an impressive 99.87% accuracy with a training set of 4,096 paths. By comparison, a traditional NB model using sparse tabular representations reached only 87.80% with the same data, highlighting the SNB's superior ability to generalize from limited samples by leveraging structural constraints.

Conclusion and Future Directions

The Structured Naive Bayes provides a powerful framework for bringing domain-specific structural knowledge into a generative probabilistic model. By using PSDDs, it preserves the computational advantages of Naive Bayes while handling combinatorial complexity. Future research may explore discriminative training methods for SNBs, potentially further enhancing classification performance in high-stakes structured domains.

Summary updated

BibTeX
@inproceedings{choi2016structured,
  author = {Arthur Choi and Nazgol Tavabi and Adnan Darwiche},
  title = {{Structured Features in Naive Bayes Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2016},
  doi = {10.1609/aaai.v30i1.10427},
}
Figure