Class BdeMetricCache
Provides a method for computing the score of a model, called the BDe metric (Bayesian Dirchlet likelihood equivalence), given a dataset (assumes no missing values) and a Bayes parameterized network (assumes no latent variables).> 0
This version has a method that computes the score for a given factor of a model, where a factor is determined by a node and its parents. It stores scores in a map whose argument is an ordered pair consisting of 1) a node and 2) set of parents. The score for the entire model is the product of the scores of its factors. Since the log of the gamma function is used here the sum of the logs is computed as the score. Compare this with the score method in the BdeMetric class which computes the score for the entire model in one pass. The advantage of the approach in this class is that it is more efficient in the context of a search algorithm where different models are scored but where many of them will have the same factors. This class stores the score (relative to the dataset) for any [node, set of parents] pair and thus avoids the expensive log gamma function calls. Instead it looks in the map scores to see if it has already computed the score and, if so, returns the previously computed value.> 0
See "Learning Bayesian Networks: The Combination of Knowledge and Statistical Data" by David Heckerman, Dan Geiger, and David M. Chickering. Microsoft Technical Report MSR-TR-94-09.> 0
- Author:
- Frank Wimberly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]
getObservedCounts
(Node node, BayesPm bayesPm, BayesIm bayesIm) This method is used in testing and debugging and not in the BDe metric calculations.int
getScoreCount
(Node node, Set<Node> parents) This is just for testing the operation of the inner class and the map from nodes and parent sets to scores.double
Computes the BDe score, using the logarithm of the gamma function, relative to the data, of the factor determined by a node and its parents.
-
Constructor Details
-
BdeMetricCache
-
-
Method Details
-
scoreLnGam
Computes the BDe score, using the logarithm of the gamma function, relative to the data, of the factor determined by a node and its parents. -
getObservedCounts
This method is used in testing and debugging and not in the BDe metric calculations. -
getScoreCount
This is just for testing the operation of the inner class and the map from nodes and parent sets to scores.
-