public class AODE
extends weka.classifiers.AbstractClassifier
implements weka.core.OptionHandler, weka.core.WeightedInstancesHandler, weka.classifiers.UpdateableClassifier, weka.core.TechnicalInformationHandler
@article{Webb2005, author = {G. Webb and J. Boughton and Z. Wang}, journal = {Machine Learning}, number = {1}, pages = {5-24}, title = {Not So Naive Bayes: Aggregating One-Dependence Estimators}, volume = {58}, year = {2005} }Valid options are:
-D Output debugging information
-F <int> Impose a frequency limit for superParents (default is 1)
-M Use m-estimate instead of laplace correction
-W <int> Specify a weight to use with m-estimate (default is 1)
Constructor and Description |
---|
AODE() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(weka.core.Instances instances)
Generates the classifier.
|
double[] |
distributionForInstance(weka.core.Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
java.lang.String |
frequencyLimitTipText()
Returns the tip text for this property
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
int |
getFrequencyLimit()
Gets the frequency limit.
|
java.lang.String[] |
getOptions()
Gets the current settings of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
weka.core.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 |
getUseMEstimates()
Gets if m-estimaces is being used.
|
int |
getWeight()
Gets the weight used in m-estimate
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
double |
NBconditionalProb(weka.core.Instance instance,
int classVal)
Calculates the probability of the specified class for the given test
instance, using naive Bayes.
|
void |
setFrequencyLimit(int f)
Sets the frequency limit
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUseMEstimates(boolean value)
Sets if m-estimates is to be used.
|
void |
setWeight(int w)
Sets the weight for m-estimate
|
java.lang.String |
toString()
Returns a description of the classifier.
|
void |
updateClassifier(weka.core.Instance instance)
Updates the classifier with the given instance.
|
java.lang.String |
useMEstimatesTipText()
Returns the tip text for this property
|
java.lang.String |
weightTipText()
Returns the tip text for this property
|
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.AbstractClassifier
public void buildClassifier(weka.core.Instances instances) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
instances
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated
successfullypublic void updateClassifier(weka.core.Instance instance)
updateClassifier
in interface weka.classifiers.UpdateableClassifier
instance
- the new training instance to include in the modelpublic double[] distributionForInstance(weka.core.Instance instance) throws java.lang.Exception
distributionForInstance
in interface weka.classifiers.Classifier
distributionForInstance
in class weka.classifiers.AbstractClassifier
instance
- the instance to be classifiedjava.lang.Exception
- if there is a problem generating the predictionpublic double NBconditionalProb(weka.core.Instance instance, int classVal)
instance
- the instance to be classifiedclassVal
- the class for which to calculate the probabilitypublic java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D Output debugging information
-F <int> Impose a frequency limit for superParents (default is 1)
-M Use m-estimate instead of laplace correction
-W <int> Specify a weight to use with m-estimate (default is 1)
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.AbstractClassifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class weka.classifiers.AbstractClassifier
public java.lang.String weightTipText()
public void setWeight(int w)
w
- the weightpublic int getWeight()
public java.lang.String useMEstimatesTipText()
public boolean getUseMEstimates()
public void setUseMEstimates(boolean value)
value
- Value to assign to m_MEstimates.public java.lang.String frequencyLimitTipText()
public void setFrequencyLimit(int f)
f
- the frequency limitpublic int getFrequencyLimit()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the options