Class BMAEstimator
- java.lang.Object
-
- weka.classifiers.bayes.net.estimate.BayesNetEstimator
-
- weka.classifiers.bayes.net.estimate.SimpleEstimator
-
- weka.classifiers.bayes.net.estimate.BMAEstimator
-
- All Implemented Interfaces:
java.io.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: 1.8 $
- Author:
- Remco Bouckaert (rrb@xm.co.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BMAEstimator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
estimateCPTs(BayesNet bayesNet)
estimateCPTs estimates the conditional probability tables for the Bayes Net using the network structure.java.lang.String[]
getOptions()
Gets the current settings of the classifier.java.lang.String
getRevision()
Returns the revision string.java.lang.String
globalInfo()
Returns a string describing this objectvoid
initCPTs(BayesNet bayesNet)
initCPTs reserves space for CPTs and set all counts to zeroboolean
isUseK2Prior()
Returns whether K2 prior is usedjava.util.Enumeration
listOptions()
Returns an enumeration describing the available optionsvoid
setOptions(java.lang.String[] options)
Parses a given list of options.void
setUseK2Prior(boolean bUseK2Prior)
Sets the UseK2Prior.void
updateClassifier(BayesNet bayesNet, Instance instance)
Updates the classifier with the given instance.-
Methods inherited from class weka.classifiers.bayes.net.estimate.SimpleEstimator
distributionForInstance
-
Methods inherited from class weka.classifiers.bayes.net.estimate.BayesNetEstimator
alphaTipText, getAlpha, setAlpha
-
-
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns a string describing this object- Overrides:
globalInfo
in classSimpleEstimator
- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
estimateCPTs
public void estimateCPTs(BayesNet bayesNet) throws java.lang.Exception
estimateCPTs estimates the conditional probability tables for the Bayes Net using the network structure.- Overrides:
estimateCPTs
in classSimpleEstimator
- Parameters:
bayesNet
- the bayes net to use- Throws:
java.lang.Exception
- if an error occurs
-
updateClassifier
public void updateClassifier(BayesNet bayesNet, Instance instance) throws java.lang.Exception
Updates the classifier with the given instance.- Overrides:
updateClassifier
in classSimpleEstimator
- Parameters:
bayesNet
- the bayes net to useinstance
- the new training instance to include in the model- Throws:
java.lang.Exception
- if the instance could not be incorporated in the model.
-
initCPTs
public void initCPTs(BayesNet bayesNet) throws java.lang.Exception
initCPTs reserves space for CPTs and set all counts to zero- Overrides:
initCPTs
in classSimpleEstimator
- Parameters:
bayesNet
- the bayes net to use- Throws:
java.lang.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
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options- Specified by:
listOptions
in interfaceOptionHandler
- Overrides:
listOptions
in classBayesNetEstimator
- Returns:
- an enumeration of all the available options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.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 interfaceOptionHandler
- Overrides:
setOptions
in classBayesNetEstimator
- Parameters:
options
- the list of options as an array of strings- Throws:
java.lang.Exception
- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the classifier.- Specified by:
getOptions
in interfaceOptionHandler
- Overrides:
getOptions
in classBayesNetEstimator
- Returns:
- an array of strings suitable for passing to setOptions
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classSimpleEstimator
- Returns:
- the revision
-
-