SearchAlgorithm (original) (raw)
java.lang.Object
- weka.classifiers.bayes.net.search.SearchAlgorithm
All Implemented Interfaces:
java.io.Serializable, OptionHandler, RevisionHandler
Direct Known Subclasses:
FromFile, GlobalScoreSearchAlgorithm, LocalScoreSearchAlgorithm, NaiveBayes
public class SearchAlgorithm
extends java.lang.Object
implements OptionHandler, java.io.Serializable, RevisionHandler
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:1.9Revision: 1.9 Revision:1.9
Author:
Remco Bouckaert
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description SearchAlgorithm() c'tor Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description void buildStructure(BayesNet bayesNet,Instances instances) buildStructure determines the network structure/graph of the network. java.lang.String[] getOptions() Gets the current settings of the Classifier. java.lang.String getRevision() Returns the revision string. java.lang.String initAsNaiveBayesTipText() java.util.Enumeration listOptions() Returns an enumeration describing the available options. java.lang.String maxNrOfParentsTipText() void setOptions(java.lang.String[] options) Parses a given list of options. java.lang.String toString() a string representation of the algorithm * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
Constructor Detail
* #### SearchAlgorithm public SearchAlgorithm() c'tor
Method Detail
* #### listOptions public java.util.Enumeration listOptions() Returns an enumeration describing the available options. Specified by: `[listOptions](../../../../../weka/core/OptionHandler.html#listOptions--)` in interface `[OptionHandler](../../../../../weka/core/OptionHandler.html "interface in weka.core")` Returns: an enumeration of all the available options. * #### setOptions public void setOptions(java.lang.String[] options) throws java.lang.Exception Parses a given list of options. Specified by: `[setOptions](../../../../../weka/core/OptionHandler.html#setOptions-java.lang.String:A-)` in interface `[OptionHandler](../../../../../weka/core/OptionHandler.html "interface in weka.core")` Parameters: `options` \- the list of options as an array of strings Throws: `java.lang.Exception` \- if an option is not supported * #### getOptions public java.lang.String[] getOptions() Gets the current settings of the Classifier. Specified by: `[getOptions](../../../../../weka/core/OptionHandler.html#getOptions--)` in interface `[OptionHandler](../../../../../weka/core/OptionHandler.html "interface in weka.core")` Returns: an array of strings suitable for passing to setOptions * #### toString public java.lang.String toString() a string representation of the algorithm Overrides: `toString` in class `java.lang.Object` Returns: a string representation * #### buildStructure public void buildStructure([BayesNet](../../../../../weka/classifiers/bayes/BayesNet.html "class in weka.classifiers.bayes") bayesNet, [Instances](../../../../../weka/core/Instances.html "class in weka.core") instances) throws java.lang.Exception 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 network `instances` \- the data to use Throws: `java.lang.Exception` \- if something goes wrong * #### maxNrOfParentsTipText public java.lang.String maxNrOfParentsTipText() Returns: a string to describe the MaxNrOfParentsoption. * #### initAsNaiveBayesTipText public java.lang.String initAsNaiveBayesTipText() Returns: a string to describe the InitAsNaiveBayes option. * #### getRevision public java.lang.String getRevision() Returns the revision string. Specified by: `[getRevision](../../../../../weka/core/RevisionHandler.html#getRevision--)` in interface `[RevisionHandler](../../../../../weka/core/RevisionHandler.html "interface in weka.core")` Returns: the revision