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
|
m_bInitAsNaiveBayes, m_bMarkovBlanketClassifier, m_nMaxNrOfParents
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
|
protected double |
calcScoreOfCounts(int[] nCounts,
int nCardinality,
int numValues,
Instances instances)
utility function used by CalcScore and CalcNodeScore to determine the score
based on observed frequencies.
|
protected double |
calcScoreOfCounts2(int[][] nCounts,
int nCardinality,
int numValues,
Instances instances) |
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() |
String[] |
getOptions()
Gets the current settings of the search algorithm.
|
String |
getRevision()
Returns the revision string.
|
SelectedTag |
getScoreType()
get quality measure to be used in searching for networks.
|
String |
globalInfo()
This will return a string describing the search algorithm.
|
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.
|
String |
markovBlanketClassifierTipText() |
String |
scoreTypeTipText() |
void |
setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier) |
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setScoreType(SelectedTag newScoreType)
set quality measure to be used in searching for networks.
|
addArcMakesSense, doMarkovBlanketCorrection, initAsNaiveBayesTipText, isArc, maxNrOfParentsTipText, reverseArcMakesSense, search, 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 Exception
buildStructure
in class SearchAlgorithm
bayesNet
- the networkinstances
- the data to useException
- if something goes wrongpublic double calcNodeScore(int nNode)
nNode
- node for which the score is calculateprotected double calcScoreOfCounts(int[] nCounts, int nCardinality, int numValues, Instances instances)
nCounts
- array with observed frequenciesnCardinality
- ardinality of parent setnumValues
- number of values a node can takeinstances
- to calc score withprotected double calcScoreOfCounts2(int[][] nCounts, int nCardinality, int numValues, Instances instances)
public 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)
setMarkovBlanketClassifier
in class SearchAlgorithm
bMarkovBlanketClassifier
- public boolean getMarkovBlanketClassifier()
getMarkovBlanketClassifier
in class SearchAlgorithm
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SearchAlgorithm
public void setOptions(String[] options) throws 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 stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SearchAlgorithm
public String scoreTypeTipText()
public String markovBlanketClassifierTipText()
markovBlanketClassifierTipText
in class SearchAlgorithm
public String globalInfo()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class SearchAlgorithm
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.