Class BMAEstimator

  • All Implemented Interfaces:
    Serializable, OptionHandler, RevisionHandler

    public class BMAEstimator
    extends SimpleEstimator
    BMAEstimator estimates conditional probability tables of a Bayes network using Bayes Model Averaging (BMA).

    Valid options are:

     -k2
      Whether to use K2 prior.
     
     -A <alpha>
      Initial count (alpha)
     
    Version:
    $Revision$
    Author:
    Remco Bouckaert (rrb@xm.co.nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • BMAEstimator

        public BMAEstimator()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this object
        Overrides:
        globalInfo in class SimpleEstimator
        Returns:
        a description of the classifier suitable for displaying in the explorer/experimenter gui
      • estimateCPTs

        public void estimateCPTs​(BayesNet bayesNet)
                          throws Exception
        estimateCPTs estimates the conditional probability tables for the Bayes Net using the network structure.
        Overrides:
        estimateCPTs in class SimpleEstimator
        Parameters:
        bayesNet - the bayes net to use
        Throws:
        Exception - if an error occurs
      • updateClassifier

        public void updateClassifier​(BayesNet bayesNet,
                                     Instance instance)
                              throws Exception
        Updates the classifier with the given instance.
        Overrides:
        updateClassifier in class SimpleEstimator
        Parameters:
        bayesNet - the bayes net to use
        instance - the new training instance to include in the model
        Throws:
        Exception - if the instance could not be incorporated in the model.
      • initCPTs

        public void initCPTs​(BayesNet bayesNet)
                      throws Exception
        initCPTs reserves space for CPTs and set all counts to zero
        Overrides:
        initCPTs in class SimpleEstimator
        Parameters:
        bayesNet - the bayes net to use
        Throws:
        Exception - if something goes wrong
      • isUseK2Prior

        public boolean isUseK2Prior()
        Returns whether K2 prior is used
        Returns:
        true if K2 prior is used
      • setUseK2Prior

        public void setUseK2Prior​(boolean bUseK2Prior)
        Sets the UseK2Prior.
        Parameters:
        bUseK2Prior - The bUseK2Prior to set
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.

        Valid options are:

         -k2
          Whether to use K2 prior.
         
         -A <alpha>
          Initial count (alpha)
         
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class BayesNetEstimator
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported