Probabilistic Search for Structured Data via Probabilistic Programming and Nonparametric Bayes

Feras Saad, Leonardo Casarsa, Vikash MansinghkaarXiv 2017

Abstract

Searching complex, multivariate databases using traditional SQL often results in brittle queries that require hard thresholds and significant domain expertise. This paper introduces a probabilistic search framework that leverages nonparametric Bayesian modeling to identify records statistically similar to a query. By defining a "predictive relevance" metric within the BayesDB platform, the authors enable robust "query-by-example" functionality that handles mixed data types and missing values effectively.

Introduction

Standard database search relies on rigid filters (e.g., tuition < 50000), which can lead to either zero results or an overwhelming amount of irrelevant data. Furthermore, traditional similarity measures like Euclidean distance often fail on tabular data with mixed types or high dimensionality. This research addresses these challenges by learning the underlying statistical structure of the data, allowing for a more intuitive and flexible search experience.

Methodology: CrossCat and Predictive Relevance

The core of this approach is CrossCat, a nonparametric Bayesian model that automatically learns the joint distribution of a database table. CrossCat partitions columns into "contexts"—groups of variables that are statistically dependent—and rows into "clusters" within those contexts.

Based on this model, the authors define predictive relevance. Unlike distance-based metrics, predictive relevance calculates the posterior probability that a candidate record provides information about a query record within a specific context. This allows the system to identify rows that are "like" the query in ways that matter for the user's specific search intent.

Implementation: BayesDB and BQL

The search functionality is integrated into BayesDB, a probabilistic programming platform. Users interact with the system using BQL (Bayesian Query Language), an extension of SQL that includes probabilistic operators.

An example BQL query demonstrating the use of the RELEVANCE PROBABILITY operator to rank results based on statistical similarity to a set of elite universities.

As shown in the figure above, the RELEVANCE PROBABILITY operator allows users to rank records based on their similarity to a set of example rows (e.g., elite universities) within a specific context (e.g., "instructional_invest").

Experimental Evaluation

The authors evaluated their framework using several real-world datasets, including the US College Scorecard, Gapminder, and a Classic Cars dataset.

In the College Scorecard evaluation, the system was used to find institutions similar to a set of target universities. The results demonstrated that the probabilistic search could identify relevant institutions even when they didn't meet strict, arbitrary thresholds.

Search results from the US College Scorecard dataset. The box plots compare the nationwide distribution of various metrics against the distributions found in two sets of search results (B and C), illustrating how the relevance metric identifies statistically similar clusters.

Key findings from the experiments include:

  • Context-Specific Similarity: The system successfully distinguishes between different types of similarity (e.g., countries similar in health indicators vs. economic indicators).
  • Robustness: The generative nature of the model allows it to handle missing data naturally by averaging over possible values.
  • Human Preference: In a study with 70 evaluators, users significantly preferred CrossCat-based rankings over standard cosine similarity baselines.

Conclusion

This work demonstrates that combining nonparametric Bayesian modeling with probabilistic programming provides a powerful tool for searching structured data. By moving from hard filters to predictive relevance, BayesDB offers a more robust and user-friendly way to explore complex databases. Future work will explore scaling these methods to web-scale, unstructured data.

Summary updated

BibTeX
@misc{saad2017probabilistic,
  author = {Feras Saad and Leonardo Casarsa and Vikash Mansinghka},
  title = {{Probabilistic Search for Structured Data via Probabilistic Programming and Nonparametric Bayes}},
  year = {2017},
  eprint = {1704.01087},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1704.01087},
}
Figure