Class SearchAlgorithm
java.lang.Object
weka.classifiers.bayes.net.search.SearchAlgorithm
- All Implemented Interfaces:
Serializable
,OptionHandler
,RevisionHandler
- Direct Known Subclasses:
FromFile
,GlobalScoreSearchAlgorithm
,LocalScoreSearchAlgorithm
,NaiveBayes
This is the base class for all search algorithms for learning Bayes networks.
It contains some common code, used by other network structure search
algorithms, and should not be used by itself.
- Version:
- $Revision: 10153 $
- Author:
- Remco Bouckaert
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildStructure
(BayesNet bayesNet, Instances instances) buildStructure determines the network structure/graph of the network.String[]
Gets the current settings of the Classifier.Returns the revision string.Returns an enumeration describing the available options.void
setOptions
(String[] options) Parses a given list of options.toString()
a string representation of the algorithm
-
Constructor Details
-
SearchAlgorithm
public SearchAlgorithm()c'tor
-
-
Method Details
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options.- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Classifier.- Specified by:
getOptions
in interfaceOptionHandler
- Returns:
- an array of strings suitable for passing to setOptions
-
toString
a string representation of the algorithm -
buildStructure
buildStructure determines the network structure/graph of the network. The default behavior is creating a network where all nodes have the first node as its parent (i.e., a BayesNet that behaves like a naive Bayes classifier). This method can be overridden by derived classes to restrict the class of network structures that are acceptable.- Parameters:
bayesNet
- the networkinstances
- the data to use- Throws:
Exception
- if something goes wrong
-
maxNrOfParentsTipText
- Returns:
- a string to describe the MaxNrOfParentsoption.
-
initAsNaiveBayesTipText
- Returns:
- a string to describe the InitAsNaiveBayes option.
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-