com.cra.bnet.learn
Class FullyObservableLearningAlgorithm

java.lang.Object
  |
  +--com.cra.bnet.learn.FullyObservableLearningAlgorithm

public class FullyObservableLearningAlgorithm
extends Object

A learning algorithm for networks whose nodes are fully observed. In other words, the data sets used with this algorithm must contain data for all nodes in the network. Fore more information please see these references:

 D. Heckerman. 1996. A Tutorial on Learning with Bayesian Networks.
 Technical Report MSR-TR-95-06, Microsoft Corporation, Redmond, Washington, USA.
 
 P. Krause. 1998. Learning Probabilistic Networks.
 The Knowledge Engineering Review, Volume 13, Issue 4, pages 321-351.
 
In general, this algorithm does Bayesian learning with Dirichlet priors. It uses the initial CPT entries as the priors. Thus, CPT entries should be set to prior values before calling the learn method. Prior CPT entries of zero cause the learning algorithm to do basic frequency counting. Priors can be set to integers to represent the observation of that many cases in the past.


Constructor Summary
FullyObservableLearningAlgorithm()
           
 
Method Summary
 void learn(DataSet data, BayesianNetwork network)
          Learns the CPT entries in the specified Bayesian network from the specified data set.
 void setPriors(BayesianNetwork network, double prior)
          Sets all CPT entries in the specified Bayesian network to the specified prior value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullyObservableLearningAlgorithm

public FullyObservableLearningAlgorithm()
Method Detail

setPriors

public void setPriors(BayesianNetwork network,
                      double prior)
Sets all CPT entries in the specified Bayesian network to the specified prior value. This method should be called before the learn method to initialize the prior conditional probabilities.

Parameters:
network - Bayesian network.
prior - prior value for all CPT entries.

learn

public void learn(DataSet data,
                  BayesianNetwork network)
Learns the CPT entries in the specified Bayesian network from the specified data set. There must be no missing data in the data set.

Clients should initialize the prior CPT entries before calling this method (using the setPriors method, or any other appropriate method). Prior values can be:

Parameters:
data - data to learn CPTs from.
network - Bayesian network.