|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.bayes.net.search.SearchAlgorithm
weka.classifiers.bayes.net.search.local.LocalScoreSearchAlgorithm
public class LocalScoreSearchAlgorithm
The ScoreBasedSearchAlgorithm class supports Bayes net structure search algorithms that are based on maximizing scores (as opposed to for example conditional independence based search algorithms).
Valid options are:-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)
Field Summary | |
---|---|
static Tag[] |
TAGS_SCORE_TYPE
the score types |
Constructor Summary | |
---|---|
LocalScoreSearchAlgorithm()
default constructor |
|
LocalScoreSearchAlgorithm(BayesNet bayesNet,
Instances instances)
constructor |
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class weka.classifiers.bayes.net.search.SearchAlgorithm |
---|
initAsNaiveBayesTipText, maxNrOfParentsTipText, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Tag[] TAGS_SCORE_TYPE
Constructor Detail |
---|
public LocalScoreSearchAlgorithm()
public LocalScoreSearchAlgorithm(BayesNet bayesNet, Instances instances)
bayesNet
- the networkinstances
- the dataMethod Detail |
---|
public double logScore(int nType)
nType
- score type (Bayes, MDL, etc) to calculate score with
public void buildStructure(BayesNet bayesNet, Instances instances) throws java.lang.Exception
buildStructure
in class SearchAlgorithm
bayesNet
- the networkinstances
- the data to use
java.lang.Exception
- if something goes wrongpublic double calcNodeScore(int nNode)
nNode
- node for which the score is calculate
public double calcScoreWithExtraParent(int nNode, int nCandidateParent)
nNode
- node for which the score is calculatenCandidateParent
- candidate parent to add to the existing parent set
public double calcScoreWithMissingParent(int nNode, int nCandidateParent)
nNode
- node for which the score is calculatenCandidateParent
- candidate parent to delete from the existing parent set
public 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 strings
java.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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |