public class SearchAlgorithm extends java.lang.Object implements OptionHandler, java.io.Serializable, RevisionHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_bInitAsNaiveBayes
determines whether initial structure is an empty graph or a Naive Bayes
network
|
protected boolean |
m_bMarkovBlanketClassifier
Determines whether after structure is found a MarkovBlanketClassifier
correction should be applied If this is true, m_bInitAsNaiveBayes is
overridden and interpreted as false.
|
protected int |
m_nMaxNrOfParents
Holds upper bound on number of parents
|
protected java.lang.String |
m_sInitalBIFFile
File name containing initial network structure.
|
| Constructor and Description |
|---|
SearchAlgorithm()
c'tor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addArcMakesSense(BayesNet bayesNet,
Instances instances,
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(BayesNet bayesNet,
Instances instances)
buildStructure determines the network structure/graph of the network.
|
protected void |
doMarkovBlanketCorrection(BayesNet bayesNet,
Instances instances)
for each node in the network make sure it is in the Markov blanket of the
classifier node, and if not, add arrows so that it is.
|
protected boolean |
getMarkovBlanketClassifier() |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
initAsNaiveBayesTipText() |
protected boolean |
isArc(BayesNet bayesNet,
int iAttributeHead,
int iAttributeTail)
IsArc checks whether the arc from iAttributeTail to iAttributeHead already
exists
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
protected java.lang.String |
markovBlanketClassifierTipText() |
java.lang.String |
maxNrOfParentsTipText() |
protected boolean |
reverseArcMakesSense(BayesNet bayesNet,
Instances instances,
int iAttributeHead,
int iAttributeTail)
reverseArcMakesSense checks whether the arc from iAttributeTail to
iAttributeHead exists and reversing does not introduce a cycle
|
protected void |
search(BayesNet bayesNet,
Instances instances) |
protected void |
setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
a string representation of the algorithm
|
protected int m_nMaxNrOfParents
protected boolean m_bInitAsNaiveBayes
protected boolean m_bMarkovBlanketClassifier
protected java.lang.String m_sInitalBIFFile
protected boolean addArcMakesSense(BayesNet bayesNet, Instances instances, int iAttributeHead, int iAttributeTail) throws java.lang.InterruptedException
bayesNet - instances - iAttributeHead - index of the attribute that becomes head of the arrowiAttributeTail - index of the attribute that becomes tail of the arrowjava.lang.InterruptedExceptionprotected boolean reverseArcMakesSense(BayesNet bayesNet, Instances instances, int iAttributeHead, int iAttributeTail)
bayesNet - instances - iAttributeHead - index of the attribute that is head of the arrowiAttributeTail - index of the attribute that is tail of the arrowprotected boolean isArc(BayesNet bayesNet, int iAttributeHead, int iAttributeTail)
bayesNet - iAttributeHead - index of the attribute that becomes head of the arrowiAttributeTail - index of the attribute that becomes tail of the arrowpublic java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface OptionHandleroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic java.lang.String toString()
toString in class java.lang.Objectpublic void buildStructure(BayesNet bayesNet, Instances instances) throws java.lang.Exception
bayesNet - the networkinstances - the data to usejava.lang.Exception - if something goes wrongprotected void search(BayesNet bayesNet, Instances instances) throws java.lang.Exception
bayesNet - instances - java.lang.Exceptionprotected void doMarkovBlanketCorrection(BayesNet bayesNet, Instances instances)
bayesNet - instances - protected void setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier)
bMarkovBlanketClassifier - protected boolean getMarkovBlanketClassifier()
public java.lang.String maxNrOfParentsTipText()
public java.lang.String initAsNaiveBayesTipText()
protected java.lang.String markovBlanketClassifierTipText()
public java.lang.String getRevision()
getRevision in interface RevisionHandler