public class LocalScoreSearchAlgorithm extends SearchAlgorithm
-mbc Applies a Markov Blanket correction to the network structure, after a network structure is learned. This ensures that all nodes in the network are part of the Markov blanket of the classifier node.
-S [BAYES|MDL|ENTROPY|AIC|CROSS_CLASSIC|CROSS_BAYES] Score type (BAYES, BDeu, MDL, ENTROPY and AIC)
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_SCORE_TYPE
the score types
|
Constructor and Description |
---|
LocalScoreSearchAlgorithm()
default constructor
|
LocalScoreSearchAlgorithm(BayesNet bayesNet,
Instances instances)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
buildStructure(BayesNet bayesNet,
Instances instances)
buildStructure determines the network structure/graph of the network
with the K2 algorithm, restricted by its initial structure (which can
be an empty graph, or a Naive Bayes graph.
|
double |
calcNodeScore(int nNode)
Calc Node Score for given parent set
|
double |
calcScoreWithExtraParent(int nNode,
int nCandidateParent)
Calc Node Score With AddedParent
|
double |
calcScoreWithMissingParent(int nNode,
int nCandidateParent)
Calc Node Score With Parent Deleted
|
boolean |
getMarkovBlanketClassifier() |
java.lang.String[] |
getOptions()
Gets the current settings of the search algorithm.
|
java.lang.String |
getRevision()
Returns the revision string.
|
SelectedTag |
getScoreType()
get quality measure to be used in searching for networks.
|
java.lang.String |
globalInfo()
This will return a string describing the search algorithm.
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options
|
double |
logScore(int nType)
logScore returns the log of the quality of a network
(e.g.
|
java.lang.String |
markovBlanketClassifierTipText() |
java.lang.String |
scoreTypeTipText() |
void |
setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setScoreType(SelectedTag newScoreType)
set quality measure to be used in searching for networks.
|
initAsNaiveBayesTipText, maxNrOfParentsTipText, toString
public static final Tag[] TAGS_SCORE_TYPE
public double logScore(int nType)
nType
- score type (Bayes, MDL, etc) to calculate score withpublic void buildStructure(BayesNet bayesNet, Instances instances) throws java.lang.Exception
buildStructure
in class SearchAlgorithm
bayesNet
- the networkinstances
- the data to usejava.lang.Exception
- if something goes wrongpublic double calcNodeScore(int nNode)
nNode
- node for which the score is calculatepublic double calcScoreWithExtraParent(int nNode, int nCandidateParent)
nNode
- node for which the score is calculatenCandidateParent
- candidate parent to add to the existing parent setpublic double calcScoreWithMissingParent(int nNode, int nCandidateParent)
nNode
- node for which the score is calculatenCandidateParent
- candidate parent to delete from the existing parent setpublic void setScoreType(SelectedTag newScoreType)
newScoreType
- the new score typepublic SelectedTag getScoreType()
public void setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier)
bMarkovBlanketClassifier
- public boolean getMarkovBlanketClassifier()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SearchAlgorithm
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-mbc Applies a Markov Blanket correction to the network structure, after a network structure is learned. This ensures that all nodes in the network are part of the Markov blanket of the classifier node.
-S [BAYES|MDL|ENTROPY|AIC|CROSS_CLASSIC|CROSS_BAYES] Score type (BAYES, BDeu, MDL, ENTROPY and AIC)
setOptions
in interface OptionHandler
setOptions
in class SearchAlgorithm
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SearchAlgorithm
public java.lang.String scoreTypeTipText()
public java.lang.String markovBlanketClassifierTipText()
public java.lang.String globalInfo()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class SearchAlgorithm