Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weka.classifiers.bayes.net.search.local
Class LocalScoreSearchAlgorithm

    java.lang.Object
      weka.classifiers.bayes.net.search.SearchAlgorithm
          weka.classifiers.bayes.net.search.local.LocalScoreSearchAlgorithm

All Implemented Interfaces:
  java.io.Serializable, OptionHandler

Direct Known Subclasses:
  CISearchAlgorithm, GeneticSearch, HillClimber, K2, SimulatedAnnealing, TAN

    public class LocalScoreSearchAlgorithm

extends SearchAlgorithm

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).

Version:
  $Revision: 1.1.2.2 $
Author:
  Remco Bouckaert
See Also:
  Serialized Form

Field Summary
`static Tag[]` | `TAGS_SCORE_TYPE`

Constructor Summary
`LocalScoreSearchAlgorithm()`
`LocalScoreSearchAlgorithm(BayesNet bayesNet, Instances instances)`

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 Classifier.
`SelectedTag` | `getScoreType()` get quality measure to be used in searching for networks.
`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

### TAGS_SCORE_TYPE

    public static final Tag[] TAGS_SCORE_TYPE

Constructor Detail

### LocalScoreSearchAlgorithm

    public LocalScoreSearchAlgorithm()

### LocalScoreSearchAlgorithm

    public LocalScoreSearchAlgorithm(BayesNet bayesNet,
                                     Instances instances)

Method Detail

### logScore

    public double logScore(int nType)

  logScore returns the log of the quality of a network (e.g. the posterior probability of the network, or the MDL value).

  Parameters:
    `nType` - score type (Bayes, MDL, etc) to calculate score with
  Returns:
    log score.

### buildStructure

    public void buildStructure(BayesNet bayesNet,
                               Instances instances)
                        throws java.lang.Exception

  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.

  Overrides:
    `buildStructure` in class `SearchAlgorithm`
  Throws:
    `java.lang.Exception`

### calcNodeScore

    public double calcNodeScore(int nNode)

  Calc Node Score for given parent set

  Parameters:
    `nNode` - node for which the score is calculate
  Returns:
    log score

### calcScoreWithExtraParent

    public double calcScoreWithExtraParent(int nNode,
                                           int nCandidateParent)

  Calc Node Score With AddedParent

  Parameters:
    `nNode` - node for which the score is calculate
    `nCandidateParent` - candidate parent to add to the existing parent set
  Returns:
    log score

### calcScoreWithMissingParent

    public double calcScoreWithMissingParent(int nNode,
                                             int nCandidateParent)

  Calc Node Score With Parent Deleted

  Parameters:
    `nNode` - node for which the score is calculate
    `nCandidateParent` - candidate parent to delete from the existing parent set
  Returns:
    log score

### setScoreType

    public void setScoreType(SelectedTag newScoreType)

  set quality measure to be used in searching for networks.

  Parameters:
    `scoreType` -

### getScoreType

    public SelectedTag getScoreType()

  get quality measure to be used in searching for networks.

  Returns:
    quality measure

### setMarkovBlanketClassifier

    public void setMarkovBlanketClassifier(boolean bMarkovBlanketClassifier)

### getMarkovBlanketClassifier

    public boolean getMarkovBlanketClassifier()

### listOptions

    public java.util.Enumeration listOptions()

  Returns an enumeration describing the available options

  Specified by:
    `listOptions` in interface `OptionHandler`
  Overrides:
    `listOptions` in class `SearchAlgorithm`
  Returns:
    an enumeration of all the available options

### setOptions

    public void setOptions(java.lang.String[] options)
                    throws java.lang.Exception

  Description copied from class: `SearchAlgorithm`
  Parses a given list of options. Valid options are:

  Specified by:
    `setOptions` in interface `OptionHandler`
  Overrides:
    `setOptions` in class `SearchAlgorithm`
  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()

  Description copied from class: `SearchAlgorithm`
  Gets the current settings of the Classifier.

  Specified by:
    `getOptions` in interface `OptionHandler`
  Overrides:
    `getOptions` in class `SearchAlgorithm`
  Returns:
    an array of strings suitable for passing to setOptions

### scoreTypeTipText

    public java.lang.String scoreTypeTipText()

  Returns:
    a string to describe the ScoreType option.

### markovBlanketClassifierTipText

    public java.lang.String markovBlanketClassifierTipText()

  Returns:
    a string to describe the MarkovBlanketClassifier option.

Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD