public class SearchAlgorithm extends Object implements OptionHandler, 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
|
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() |
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
String |
initAsNaiveBayesTipText() |
protected boolean |
isArc(BayesNet bayesNet,
int iAttributeHead,
int iAttributeTail)
IsArc checks whether the arc from iAttributeTail to iAttributeHead already exists
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
protected String |
markovBlanketClassifierTipText() |
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(String[] options)
Parses a given list of options.
|
String |
toString()
a string representation of the algorithm
|
protected int m_nMaxNrOfParents
protected boolean m_bInitAsNaiveBayes
protected boolean m_bMarkovBlanketClassifier
protected boolean addArcMakesSense(BayesNet bayesNet, Instances instances, int iAttributeHead, int iAttributeTail)
bayesNet
- instances
- iAttributeHead
- index of the attribute that becomes head of the arrowiAttributeTail
- index of the attribute that becomes tail of the arrowprotected 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 Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public String toString()
public void buildStructure(BayesNet bayesNet, Instances instances) throws Exception
bayesNet
- the networkinstances
- the data to useException
- if something goes wrongprotected void search(BayesNet bayesNet, Instances instances) throws Exception
bayesNet
- instances
- Exception
protected void doMarkovBlanketCorrection(BayesNet bayesNet, Instances instances)
bayesNet
- instances
- protected void setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier)
bMarkovBlanketClassifier
- protected boolean getMarkovBlanketClassifier()
public String maxNrOfParentsTipText()
public String initAsNaiveBayesTipText()
protected String markovBlanketClassifierTipText()
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.