weka.classifiers.bayes
Class BayesNetB
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.bayes.BayesNet
weka.classifiers.bayes.BayesNetB
- All Implemented Interfaces:
- java.lang.Cloneable, Drawable, OptionHandler, java.io.Serializable, WeightedInstancesHandler
- Direct Known Subclasses:
- BayesNetB2
- public class BayesNetB
- extends BayesNet
Class for a Bayes Network classifier based on a hill climbing algorithm for
learning structure as described in Buntine, W. (1991). Theory refinement on
Bayesian networks. In Proceedings of Seventh Conference on Uncertainty in
Artificial Intelligence, Los Angeles, CA, pages 52--60. Morgan Kaufmann.
Works with nominal variables and no missing values only.
- Version:
- $Revision: 1.3 $
- Author:
- Remco Bouckaert (rrb@xm.co.nz)
- See Also:
- Serialized Form
Fields inherited from class weka.classifiers.bayes.BayesNet |
m_ADTree, m_bInitAsNaiveBayes, m_bUseADTree, m_Distributions, m_fAlpha, m_Instances, m_nMaxNrOfParents, m_nOrder, m_nScoreType, m_NumClasses, m_ParentSets, TAGS_SCORE_TYPE |
Method Summary |
private boolean |
AddArcMakesSense(int iAttributeHead,
int iAttributeTail)
AddArcMakesSense checks whether adding the arc from iAttributeTail to iAttributeHead
does not already exists and does not introduce a cycle |
void |
buildStructure()
buildStructure determines the network structure/graph of the network
with Buntines greedy hill climbing algorithm, restricted by its initial
structure (which can be an empty graph, or a Naive Bayes graph. |
java.lang.String |
globalInfo()
This will return a string describing the classifier. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
Methods inherited from class weka.classifiers.bayes.BayesNet |
alphaTipText, buildClassifier, CalcNodeScore, CalcScoreOfCounts, CalcScoreOfCounts2, CalcScoreWithExtraParent, countsForInstance, distributionForInstance, estimateCPTs, getAlpha, getInitAsNaiveBayes, getMaxNrOfParents, getOptions, getScoreType, getUseADTree, graph, graphType, initAsNaiveBayesTipText, initStructure, listOptions, logScore, maxNrOfParentsTipText, scoreTypeTipText, setAlpha, setInitAsNaiveBayes, setMaxNrOfParents, setOptions, setScoreType, setUseADTree, toString, toXMLBIF03, updateClassifier, useADTreeTipText, XMLNormalize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BayesNetB
public BayesNetB()
buildStructure
public void buildStructure()
throws java.lang.Exception
- buildStructure determines the network structure/graph of the network
with Buntines greedy hill climbing algorithm, restricted by its initial
structure (which can be an empty graph, or a Naive Bayes graph.
- Overrides:
buildStructure
in class BayesNet
- Throws:
java.lang.Exception
AddArcMakesSense
private boolean AddArcMakesSense(int iAttributeHead,
int iAttributeTail)
- AddArcMakesSense checks whether adding the arc from iAttributeTail to iAttributeHead
does not already exists and does not introduce a cycle
- Parameters:
iAttributeHead
- index of the attribute that becomes head of the arrowiAttributeTail
- index of the attribute that becomes tail of the arrow
- Returns:
- true if adding arc is allowed, otherwise false
globalInfo
public java.lang.String globalInfo()
- This will return a string describing the classifier.
- Returns:
- The string.
main
public static void main(java.lang.String[] argv)
- Main method for testing this class.
- Parameters:
argv
- the options