|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.bayes.DMNBtext
public class DMNBtext
Class for building and using a Discriminative Multinomial Naive Bayes classifier. For more information see,
Jiang Su,Harry Zhang,Charles X. Ling,Stan Matwin: Discriminative Parameter Learning for Bayesian Networks. In: ICML 2008', 2008.
The core equation for this classifier:
P[Ci|D] = (P[D|Ci] x P[Ci]) / P[D] (Bayes rule)
where Ci is class i and D is a document.
@inproceedings{JiangSu2008,
author = {Jiang Su,Harry Zhang,Charles X. Ling,Stan Matwin},
booktitle = {ICML 2008'},
title = {Discriminative Parameter Learning for Bayesian Networks},
year = {2008}
}
Valid options are:
-I <iterations> The number of iterations that the classifier will scan the training data (default = 1)
-M Use the frequency information in data
| Nested Class Summary | |
|---|---|
class |
DMNBtext.DNBBinary
|
| Constructor Summary | |
|---|---|
DMNBtext()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances data)
Generates the classifier. |
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
boolean |
getMultinomialWord()
Gets whether use binary text representation |
int |
getNumIterations()
Gets the number of iterations to be performed |
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. |
String |
globalInfo()
Returns a string describing this classifier |
Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for testing this class. |
String |
multinomialWordTipText()
Returns the tip text for this property |
String |
numIterationsTipText()
Returns the tip text for this property |
void |
setMultinomialWord(boolean val)
Sets whether use binary text representation |
void |
setNumIterations(int numIterations)
Sets the number of iterations to be performed |
void |
setOptions(String[] options)
Parses a given list of options. |
String |
toString()
Returns a string representation of the classifier. |
void |
updateClassifier(Instance instance)
Updates the classifier with the given instance. |
| 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 Detail |
|---|
public DMNBtext()
| Method Detail |
|---|
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ClassifierCapabilities
public void buildClassifier(Instances data)
throws Exception
buildClassifier in class Classifierinstances - set of instances serving as training data
Exception - if the classifier has not been generated successfully
public void updateClassifier(Instance instance)
throws Exception
updateClassifier in interface UpdateableClassifierinstance - the new training instance to include in the model
Exception - if the instance could not be incorporated in
the model.
public double[] distributionForInstance(Instance instance)
throws Exception
distributionForInstance in class Classifierinstance - the instance to be classified
Exception - if there is a problem generating the predictionpublic String toString()
toString in class Objectpublic Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifier
public void setOptions(String[] options)
throws Exception
Classifier
-D
If set, classifier is run in debug mode and
may output additional info to the console.
setOptions in interface OptionHandlersetOptions in class Classifieroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Classifierpublic String numIterationsTipText()
public void setNumIterations(int numIterations)
public int getNumIterations()
public String multinomialWordTipText()
public void setMultinomialWord(boolean val)
public boolean getMultinomialWord()
public String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(String[] argv)
argv - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||