Package opennlp.tools.ml.naivebayes
Class LogProbabilities<T>
java.lang.Object
opennlp.tools.ml.naivebayes.Probabilities<T>
opennlp.tools.ml.naivebayes.LogProbabilities<T>
- Type Parameters:
- T- the label (category) class
Class implementing the probability distribution over labels returned by
 a classifier as a log of probabilities.
 
This is necessary because floating point precision in Java does not allow for high-accuracy representation of very low probabilities such as would occur in a text categorizer.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCompounds the existingprobabilitymass on the labeltwith the new probability passed in to the method.voiddiscardCountsBelow(double i) getAll()getMax()voidAssigns aprobabilityto a labelt, discarding any previously assigned probability.voidset(T t, Probability<T> probability) Assigns aprobabilityto a labelt, discarding any previously assigned probability.voidsetIfLarger(T t, double probability) Assigns aprobabilityto a labelt, discarding any previously assigned probability, if the new probability is greater than the old one.voidAssigns a logprobabilityto a labelt, discarding any previously assigned probability.Methods inherited from class opennlp.tools.ml.naivebayes.ProbabilitiesgetConfidence, getKeys, getMaxValue, setConfidence, toString
- 
Constructor Details- 
LogProbabilitiespublic LogProbabilities()
 
- 
- 
Method Details- 
setAssigns aprobabilityto a labelt, discarding any previously assigned probability.- Overrides:
- setin class- Probabilities<T>
- Parameters:
- t- The label to which the probability is being assigned.
- probability- The probability to assign.
 
- 
setAssigns aprobabilityto a labelt, discarding any previously assigned probability.- Overrides:
- setin class- Probabilities<T>
- Parameters:
- t- The label to which the probability is being assigned.
- probability- The- Probability<T>to assign.
 
- 
setIfLargerAssigns aprobabilityto a labelt, discarding any previously assigned probability, if the new probability is greater than the old one.- Overrides:
- setIfLargerin class- Probabilities<T>
- Parameters:
- t- The label to which the probability is being assigned.
- probability- The probability to assign.
 
- 
setLogAssigns a logprobabilityto a labelt, discarding any previously assigned probability.- Overrides:
- setLogin class- Probabilities<T>
- Parameters:
- t- The label to which the log probability is being assigned.
- probability- The log- probabilityto assign.
 
- 
addInCompounds the existingprobabilitymass on the labeltwith the new probability passed in to the method.- Overrides:
- addInin class- Probabilities<T>
- Parameters:
- t- The label whose- probabilitymass is being updated.
- probability- The probability weight to add.
- count- The amplifying factor for the- probabilitycompounding.
 
- 
get- Overrides:
- getin class- Probabilities<T>
- Parameters:
- t- The label whose probability shall be returned.
- Returns:
- Retrieves the probability associated with the label t.
 
- 
getLog- Overrides:
- getLogin class- Probabilities<T>
- Parameters:
- t- The label whose log probability shall be returned.
- Returns:
- Retrieves the log probability associated with the label t.
 
- 
discardCountsBelowpublic void discardCountsBelow(double i) - Overrides:
- discardCountsBelowin class- Probabilities<T>
 
- 
getAll- Overrides:
- getAllin class- Probabilities<T>
- Returns:
- Retrieves a Mapof all labels and their probabilities.
 
- 
getMax- Overrides:
- getMaxin class- Probabilities<T>
- Returns:
- Retrieves the label that has the highest associated probability
 
 
-