public class NaiveBayesMultinomial extends AbstractClassifier
@inproceedings{Mccallum1998, author = {Andrew Mccallum and Kamal Nigam}, booktitle = {AAAI-98 Workshop on 'Learning for Text Categorization'}, title = {A Comparison of Event Models for Naive Bayes Text Classification}, year = {1998} }
Modifier and Type | Field and Description |
---|---|
FloatOption |
laplaceCorrectionOption |
protected double[] |
m_classTotals
sum of weight_of_instance * word_count_of_instance for each class
|
protected weka.core.Instances |
m_headerInfo
copy of header information for use in toString method
|
protected int |
m_numClasses
number of class values
|
protected double[] |
m_probOfClass
the probability of a class (i.e.
|
protected DoubleVector[] |
m_wordTotalForClass
probability that a word (w) exists in a class (H) (i.e.
|
protected boolean |
reset |
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
classOptionNamesToPreparedObjects, options
Constructor and Description |
---|
NaiveBayesMultinomial() |
Modifier and Type | Method and Description |
---|---|
void |
getModelDescription(StringBuilder result,
int indent)
Returns a string representation of the model.
|
protected Measurement[] |
getModelMeasurementsImpl()
Gets the current measurements of this classifier.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. |
String |
getPurposeString()
Gets the purpose of this object
|
double[] |
getVotesForInstance(weka.core.Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
boolean |
isRandomizable()
Gets whether this classifier needs a random seed.
|
void |
resetLearningImpl()
Resets this classifier.
|
double |
totalSize(weka.core.Instance instance) |
void |
trainOnInstanceImpl(weka.core.Instance inst)
Trains the classifier with the given instance.
|
contextIsCompatible, copy, correctlyClassifies, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModelContext, getModelMeasurements, getNominalValueString, getSubClassifiers, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance
discoverOptionsViaReflection, getCLICreationString, getOptions, getPreparedClassOption, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCLICreationString, getOptions, prepareForUse, prepareForUse
measureByteSize
public FloatOption laplaceCorrectionOption
protected double[] m_classTotals
protected weka.core.Instances m_headerInfo
protected int m_numClasses
protected double[] m_probOfClass
protected DoubleVector[] m_wordTotalForClass
protected boolean reset
public String getPurposeString()
OptionHandler
getPurposeString
in interface OptionHandler
getPurposeString
in class AbstractClassifier
public void resetLearningImpl()
AbstractClassifier
resetLearningImpl
in class AbstractClassifier
public void trainOnInstanceImpl(weka.core.Instance inst)
trainOnInstanceImpl
in class AbstractClassifier
instance
- the new training instance to include in the modelpublic double[] getVotesForInstance(weka.core.Instance instance)
instance
- the instance to be classifiedpublic double totalSize(weka.core.Instance instance)
protected Measurement[] getModelMeasurementsImpl()
AbstractClassifier
getModelMeasurementsImpl
in class AbstractClassifier
public void getModelDescription(StringBuilder result, int indent)
AbstractClassifier
getModelDescription
in class AbstractClassifier
result
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic boolean isRandomizable()
Classifier
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.