A recent trend for solving frequent itemset mining problems is to formulate them as constraint programming problems (Guns et al. 2011b). This approach follows the declarative programming paradigm, as the itemset mining problem is expressed by specifying a set of variables, their domains, and a number of constraints over them. It is then up to the constraint solving system to find solutions for the problem. In contrast to typical itemset mining methods that only address a certain variant of itemset mining problems (or have to be substantially modified to extend to another variant), adapting a constraint programming formulation of this problem to a new setting is often possible by adding or modifying a set of constraints. It has also been demonstrated that computational efficiency of this solving technique can be improved by introducing new means of data representation and novel propagation schemes. Let S be the set of transactions in the databseDand I be the set of items.
To model the problem of frequent itemset mining in constraint programming, we use a boolean variableIi for each item and a boolean variableTtfor each
transaction. A solution will correspond to a frequent itemset which is represented by Ii variables that are set to one. A variableTt will be equal to one if the
corresponding transaction contains this itemset. The following constraints establish the relationship between the variablesIi andTt:
Tt= 1↔
^
i∈I
(Dti= 1∨Ii= 0) ∀t∈ S
where the parameterDti is equal to one if transactiont contains itemi and
is equal to zero otherwise. The frequency constraint can be expressed as the following CP constraint:
PATTERN MINING 27
X
t∈S
Tt≥θ
This formulation can be easily extended to model the problem of maximal frequent itemset mining. By adding the following constraints to the model, the set of solutions will only include the maximal itemsets:
Ii= 0→
X
t∈S
TtDti< θ ∀i∈ I
This concludes our review of probabilistic graphical models, constraint programming, integer programming and constraint-based pattern mining. In this review, we treated these domains independently, as they have been quite independent of each other in their development. In the consequent chapters we will see some of the connections between these domains and the ways in which they interact.
Part I
Probabilistic Models in
Constraint Satisfaction and
Optimization
Chapter 3
Constraint-Based Querying
for Bayesian Network
Exploration
In this chapter, we introduce a novel general framework and tool for answering exploratory queries over Bayesian networks. The framework is inspired by queries from the constraint-based mining literature designed for the exploratory analysis of data. This chapter is based on the following paper:
• Behrouz Babaki, Tias Guns, Siegfried Nijssen, and Luc De Raedt. “Constraint-based querying for bayesian network exploration”. In Élisa
Fromont, Tijl De Bie, and Matthijs van Leeuwen, editors, Advances in Intel- ligent Data Analysis XIV - 14th International Symposium, IDA 2015, Saint Etienne, France, October 22-24, 2015, Proceedings, volume 9385 ofLecture Notes in Computer Science,pages 13–24. Springer, 2015.
3.1
Introduction
Understanding a Bayesian network is not always easy. In particular users who are faced with a large network for the first time, or with networks that are dynamically updated when new data arrives, may not understand the knowledge encoded in such a network. It has been argued that BN’s (especially those used
EXAMPLES OF BAYESIAN NETWORK EXPLORATION 31
for diagnosis) should be extensively evaluated before being used in practice (Przytula et al. 2003).
While the Bayesian network literature already provides a set of queries and corresponding inference techniques that are helpful in gaining a better understanding of a network, most of the standard queries specify (and fix) the variables of interest, and then either ask for a most likely assignment to the variables or the computation of a particular probability.
This contrasts with common practice in the field of exploratory data mining, where one aims at understanding data by discovering and analyzing patterns. Since the seminal work on frequent itemset mining by Agrawal et al. (Agrawal, Imielinski, et al. 1993), numerous techniques for exploratory mining of patterns under constraints have been developed (Nijssen and Zimmermann 2014). The notions of frequency and pattern in constraint-based pattern mining actually correspond to the notions of probability and explanation in a Bayesian network. In pattern mining, one typically searches over a space of possible patterns. In Bayesian networks, this corresponds to searching over subsets of variables and their values. In this paper, we exploit the similarities between these two fields and introduce constraint-based queries for Bayesian networks.
The contribution of this chapter is three-fold. First, inspired by constraint- based mining, we introduce an expressive set of exploratory queries for Bayesian networks. Secondly, we identify how these queries can be expressed as constraints over the variables and joint distribution of the Bayesian network. Finally, we show how these constraints can be expressed as a generic constraint program, combining ideas from constraint programming, itemset mining and knowledge compilation, in particular CP4IM (Guns et al. 2011b) and arithmetic circuits (AC) (Darwiche 2003). Our method operates on the arithmetic circuit directly and can hence be applied to any graphical model that can be compiled into an AC. By doing so, we bridge the gap between constraint-based pattern mining and graphical models and contribute towards more intelligent analysis of Bayesian networks.