|
|||||||||||
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 |
java.lang.String[] |
getOptions()
Gets the current settings of the classifier. |
java.lang.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. |
java.lang.String |
globalInfo()
Returns a string describing this classifier |
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
multinomialWordTipText()
Returns the tip text for this property |
java.lang.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(java.lang.String[] options)
Parses a given list of options. |
java.lang.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 java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training data
java.lang.Exception
- if the classifier has not been generated successfullypublic void updateClassifier(Instance instance) throws java.lang.Exception
updateClassifier
in interface UpdateableClassifier
instance
- the new training instance to include in the model
java.lang.Exception
- if the instance could not be incorporated in
the model.public double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if there is a problem generating the predictionpublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Classifier
-D
If set, classifier is run in debug mode and
may output additional info to the console.
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
public java.lang.String numIterationsTipText()
public void setNumIterations(int numIterations)
public int getNumIterations()
public java.lang.String multinomialWordTipText()
public void setMultinomialWord(boolean val)
public boolean getMultinomialWord()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |