Package weka.classifiers.bayes

# Class AODEsr

java.lang.Object
weka.classifiers.Classifier
weka.classifiers.bayes.AODEsr

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `UpdateableClassifier`, `CapabilitiesHandler`, `OptionHandler`, `RevisionHandler`, `TechnicalInformationHandler`, `WeightedInstancesHandler`

public class AODEsr extends Classifier implements OptionHandler, WeightedInstancesHandler, UpdateableClassifier, TechnicalInformationHandler
AODEsr augments AODE with Subsumption Resolution.AODEsr detects specializations between two attribute values at classification time and deletes the generalization attribute value.
For more information, see:
Fei Zheng, Geoffrey I. Webb: Efficient Lazy Elimination for Averaged-One Dependence Estimators. In: Proceedings of the Twenty-third International Conference on Machine Learning (ICML 2006), 1113-1120, 2006.

BibTeX:

     @inproceedings{Zheng2006,
        author = {Fei Zheng and Geoffrey I. Webb},
        booktitle = {Proceedings of the Twenty-third International Conference on Machine  Learning (ICML 2006)},
        pages = {1113-1120},
        publisher = {ACM Press},
        title = {Efficient Lazy Elimination for Averaged-One Dependence Estimators},
        year = {2006},
        ISBN = {1-59593-383-2}
     }

Valid options are:

     -D
      Output debugging information

     -C
      Impose a critcal value for specialization-generalization relationship
      (default is 50)

     -F
      Impose a frequency limit for superParents
      (default is 1)

     -L
      Using Laplace estimation
      (default is m-esimation (m=1))

     -M
      Weight value for m-estimation
      (default is 1.0)

Version:
  $Revision: 5516 $
Author:
  Fei Zheng, Janice Boughton
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`AODEsr()`

## Method Summary

Modifier and Type
Method
Description
`void`
`buildClassifier(Instances instances)`
Generates the classifier.
`String`
`criticalValueTipText()`
Returns the tip text for this property
`double[]`
`distributionForInstance(Instance instance)`
Calculates the class membership probabilities for the given test instance.
`String`
`frequencyLimitTipText()`
Returns the tip text for this property
`Capabilities`
`getCapabilities()`
Returns default capabilities of the classifier.
`int`
`getCriticalValue()`
Gets the critical value.
`int`
`getFrequencyLimit()`
Gets the frequency limit.
`double`
`getMestWeight()`
Gets the weight used in m-estimate
`String[]`
`getOptions()`
Gets the current settings of the classifier.
`String`
`getRevision()`
Returns the revision string.
`TechnicalInformation`
`getTechnicalInformation()`
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
`boolean`
`getUseLaplace()`
Gets if laplace correction is being used.
`String`
`globalInfo()`
Returns a string describing this classifier
`double`
`LaplaceEstimate(double frequency, double total, double numValues)`
Returns the probability estimate, using laplace correction
`Enumeration`
`listOptions()`
Returns an enumeration describing the available options
`static void`
`main(String[] argv)`
Main method for testing this class.
`double`
`MEstimate(double frequency, double total, double numValues)`
Returns the probability estimate, using m-estimate
`String`
`mestWeightTipText()`
Returns the tip text for this property
`double`
`NBconditionalProb(Instance instance, int classVal)`
Calculates the probability of the specified class for the given test instance, using naive Bayes.
`void`
`setCriticalValue(int c)`
Sets the critical value
`void`
`setFrequencyLimit(int f)`
Sets the frequency limit
`void`
`setMestWeight(double w)`
Sets the weight for m-estimate
`void`
`setOptions(String[] options)`
Parses a given list of options.
`void`
`setUseLaplace(boolean value)`
Sets if laplace correction is to be used.
`String`
`toString()`
Returns a description of the classifier.
`void`
`updateClassifier(Instance instance)`
Updates the classifier with the given instance.
`String`
`useLaplaceTipText()`
Returns the tip text for this property

### Methods inherited from class weka.classifiers.Classifier

`classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AODEsr

public AODEsr()

## Method Details

### globalInfo

public String globalInfo()
Returns a string describing this classifier

Returns:
  a description of the classifier suitable for displaying in the explorer/experimenter gui

### getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.

Specified by:
  `getTechnicalInformation` in interface `TechnicalInformationHandler`
Returns:
  the technical information about this class

### getCapabilities

public Capabilities getCapabilities()
Returns default capabilities of the classifier.

Specified by:
  `getCapabilities` in interface `CapabilitiesHandler`
Overrides:
  `getCapabilities` in class `Classifier`
Returns:
  the capabilities of this classifier
See Also:
  - `Capabilities`

### buildClassifier

public void buildClassifier(Instances instances) throws Exception
Generates the classifier.

Specified by:
  `buildClassifier` in class `Classifier`
Parameters:
  `instances` - set of instances serving as training data
Throws:
  `Exception` - if the classifier has not been generated successfully

### updateClassifier

public void updateClassifier(Instance instance)
Updates the classifier with the given instance.

Specified by:
  `updateClassifier` in interface `UpdateableClassifier`
Parameters:
  `instance` - the new training instance to include in the model
Throws:
  `Exception` - if the instance could not be incorporated in the model.

### distributionForInstance

public double[] distributionForInstance(Instance instance) throws Exception
Calculates the class membership probabilities for the given test instance.

Overrides:
  `distributionForInstance` in class `Classifier`
Parameters:
  `instance` - the instance to be classified
Returns:
  predicted class probability distribution
Throws:
  `Exception` - if there is a problem generating the prediction

### NBconditionalProb

public double NBconditionalProb(Instance instance, int classVal) throws Exception
Calculates the probability of the specified class for the given test instance, using naive Bayes.

Parameters:
  `instance` - the instance to be classified
  `classVal` - the class for which to calculate the probability
Returns:
  predicted class probability
Throws:
  `Exception` - if there is a problem generating the prediction

### MEstimate

public double MEstimate(double frequency, double total, double numValues)
Returns the probability estimate, using m-estimate

Parameters:
  `frequency` - frequency of value of interest
  `total` - count of all values
  `numValues` - number of different values
Returns:
  the probability estimate

### LaplaceEstimate

public double LaplaceEstimate(double frequency, double total, double numValues)
Returns the probability estimate, using laplace correction

Parameters:
  `frequency` - frequency of value of interest
  `total` - count of all values
  `numValues` - number of different values
Returns:
  the probability estimate

### listOptions

public Enumeration listOptions()
Returns an enumeration describing the available options

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

### setOptions

public void setOptions(String[] options) throws Exception
Parses a given list of options.

Valid options are:

     -D
      Output debugging information

     -C
      Impose a critcal value for specialization-generalization relationship
      (default is 50)

     -F
      Impose a frequency limit for superParents
      (default is 1)

     -L
      Using Laplace estimation
      (default is m-esimation (m=1))

     -M
      Weight value for m-estimation
      (default is 1.0)

Specified by:
  `setOptions` in interface `OptionHandler`
Overrides:
  `setOptions` in class `Classifier`
Parameters:
  `options` - the list of options as an array of strings
Throws:
  `Exception` - if an option is not supported

### getOptions

public String[] getOptions()
Gets the current settings of the classifier.

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

### mestWeightTipText

public String mestWeightTipText()
Returns the tip text for this property

Returns:
  tip text for this property suitable for displaying in the explorer/experimenter gui

### setMestWeight

public void setMestWeight(double w)
Sets the weight for m-estimate

Parameters:
  `w` - the weight

### getMestWeight

public double getMestWeight()
Gets the weight used in m-estimate

Returns:
  the weight for m-estimation

### useLaplaceTipText

public String useLaplaceTipText()
Returns the tip text for this property

Returns:
  tip text for this property suitable for displaying in the explorer/experimenter gui

### getUseLaplace

public boolean getUseLaplace()
Gets if laplace correction is being used.

Returns:
  Value of m_Laplace.

### setUseLaplace

public void setUseLaplace(boolean value)
Sets if laplace correction is to be used.

Parameters:
  `value` - Value to assign to m_Laplace.

### frequencyLimitTipText

public String frequencyLimitTipText()
Returns the tip text for this property

Returns:
  tip text for this property suitable for displaying in the explorer/experimenter gui

### setFrequencyLimit

public void setFrequencyLimit(int f)
Sets the frequency limit

Parameters:
  `f` - the frequency limit

### getFrequencyLimit

public int getFrequencyLimit()
Gets the frequency limit.

Returns:
  the frequency limit

### criticalValueTipText

public String criticalValueTipText()
Returns the tip text for this property

Returns:
  tip text for this property suitable for displaying in the explorer/experimenter gui

### setCriticalValue

public void setCriticalValue(int c)
Sets the critical value

Parameters:
  `c` - the critical value

### getCriticalValue

public int getCriticalValue()
Gets the critical value.

Returns:
  the critical value

### toString

public String toString()
Returns a description of the classifier.

Overrides:
  `toString` in class `Object`
Returns:
  a description of the classifier as a string.

### getRevision

public String getRevision()
Returns the revision string.

Specified by:
  `getRevision` in interface `RevisionHandler`
Overrides:
  `getRevision` in class `Classifier`
Returns:
  the revision

### main

public static void main(String[] argv)
Main method for testing this class.

Parameters:
  `argv` - the options