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, trainingWeightSeenByModelclassOptionNamesToPreparedObjects, 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, trainOnInstancediscoverOptionsViaReflection, getCLICreationString, getOptions, getPreparedClassOption, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUsecopy, measureByteSize, measureByteSize, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCLICreationString, getOptions, prepareForUse, prepareForUsemeasureByteSizepublic 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()
OptionHandlergetPurposeString in interface OptionHandlergetPurposeString in class AbstractClassifierpublic void resetLearningImpl()
AbstractClassifierresetLearningImpl in class AbstractClassifierpublic void trainOnInstanceImpl(weka.core.Instance inst)
trainOnInstanceImpl in class AbstractClassifierinstance - 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()
AbstractClassifiergetModelMeasurementsImpl in class AbstractClassifierpublic void getModelDescription(StringBuilder result, int indent)
AbstractClassifiergetModelDescription in class AbstractClassifierresult - the stringbuilder to add the descriptionindent - the number of characters to indentpublic boolean isRandomizable()
ClassifierCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.