A Database Framework for Classifier Engineering

Benny Kimelfeld, Christopher RéAMW 2015

Introduction

In the current machine learning landscape, feature engineering is often regarded as a "black art"—a labor-intensive process of trial and error that relies more on intuition than formal theory. While numerous tools exist to automate parts of the pipeline, there is a distinct lack of a rigorous foundation explaining how features interact with the underlying relational data structures from which they are derived.

This vision paper proposes a formal, database-centric framework for "classifier engineering." By treating features as relational queries, the authors bridge the gap between database theory and statistical learning, identifying fundamental algorithmic challenges that govern the creation of effective classifiers.

The "Features as Queries" Paradigm

The core insight of this framework is that most data used in machine learning resides in relational databases. Consequently, a binary feature—such as "is the user located in New York?"—is essentially a filter applied to an entity set. By defining features as queries (specifically Conjunctive Queries, or CQs), researchers can leverage decades of database theory, including concepts like query containment and equivalence, to optimize and automate feature selection.

The Formal Framework

The authors introduce a framework consisting of two primary components:

  1. Entity Schemas: An extension of standard relational schemas that designates a specific "entity" relation (e.g., a Users or Products table) as the primary subject of classification.
  2. Feature Queries: Features are defined as queries that select a subset of these entities. For instance, a feature might be represented as a CQ that joins multiple tables to identify specific attributes of an entity.

Fundamental Challenges: Separability and Identifiability

The framework identifies two critical properties that determine the viability of a set of features for training a model:

1. Separability

Separability asks whether a given set of feature queries allows a specific class of models (such as linear classifiers) to perfectly distinguish between positive and negative training examples. If a dataset is not separable, no matter how much training occurs, the model will never achieve zero error on the training set using those specific features.

2. Identifiability

Identifiability concerns the independence of features. In machine learning, if features are perfectly correlated or redundant, the model may encounter stability issues or have an infinite number of optimal solutions. The authors formalize this as a property of the queries themselves: a set of features is identifiable if the queries are not redundant relative to one another.

Complexity Results

To evaluate the feasibility of automating feature engineering, the authors performed a complexity analysis on these problems using Conjunctive Queries without constants ($CQ^{nc}$) and linear classifiers. Their findings provide a theoretical explanation for why feature engineering is inherently difficult:

  • Theorem 1 (Separability): Determining if a training set is separable using $CQ^{nc}$ features and a linear classifier is NP-complete.
  • Theorem 2 (Identifiability): For additive conjunctive queries, a set of features is identifiable if and only if it contains no redundant (equivalent) queries. However, because checking for query equivalence is itself a hard problem, checking for feature identifiability is also NP-complete.

These results suggest that even for very restricted query classes and simple models, finding the "optimal" set of features is computationally expensive.

Future Directions

As a vision paper, this work sets the stage for several new avenues of research at the intersection of DB and ML:

  • Beyond Binary Features: Future work must extend the framework to include numerical features, such as counts and averages, which require aggregate queries.
  • Approximate Separability: In real-world scenarios, perfect separation is rarely achieved or required. Extending the theory to handle noise and "good enough" separation is a logical next step.
  • Heuristic Search: Given that the core problems are NP-complete, there is a significant need for efficient heuristics or approximation algorithms that can operate within a database engine to assist in feature discovery.

Conclusion

By moving the "intelligence" of machine learning closer to the data layer, this framework allows the database engine to take an active role in classifier engineering. While the underlying problems are computationally hard, formalizing them allows the community to apply established database techniques to make the "black art" of feature engineering more systematic and rigorous.

Summary updated

BibTeX
@inproceedings{kimelfeld2015database,
  author = {Benny Kimelfeld and Christopher Ré},
  title = {{A Database Framework for Classifier Engineering}},
  booktitle = {AMW},
  year = {2015},
  url = {https://openreview.net/forum?id=jFtHS12cJsw},
}
Figure