Package opennlp.tools.ml.naivebayes
Class LogProbability<T>
java.lang.Object
opennlp.tools.ml.naivebayes.Probability<T>
opennlp.tools.ml.naivebayes.LogProbability<T>
- Type Parameters:
- T- The label (category) class.
A class implementing the logarithmic 
Probability for a label.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddIn(double probability) Compounds the existingprobabilitymass on the label with the new probability passed in to the method.get()getLabel()getLog()booleanisLarger(Probability<T> probability) Checks if a probability is greater than the old one.voidset(double probability) Assigns aprobabilityto a label, discarding any previously assigned probability.voidset(Probability<T> probability) Assigns aprobabilityto a label, discarding any previously assigned probability.voidsetIfLarger(double probability) Assigns aprobabilityto a label, discarding any previously assigned probability, if the new probability is greater than the old one.voidsetIfLarger(Probability<T> probability) Assigns aprobabilityto a label, discarding any previously assigned probability, if the new probability is greater than the old one.voidsetLog(double probability) Assigns a logprobabilityto a label, discarding any previously assigned probability.toString()
- 
Constructor Details- 
LogProbability
 
- 
- 
Method Details- 
setpublic void set(double probability) Assigns aprobabilityto a label, discarding any previously assigned probability.- Overrides:
- setin class- Probability<T>
- Parameters:
- probability- The probability to assign.
 
- 
setAssigns aprobabilityto a label, discarding any previously assigned probability.- Overrides:
- setin class- Probability<T>
- Parameters:
- probability- The- Probabilityto assign.
 
- 
setIfLargerpublic void setIfLarger(double probability) Assigns aprobabilityto a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Overrides:
- setIfLargerin class- Probability<T>
- Parameters:
- probability- The probability to assign.
 
- 
setIfLargerAssigns aprobabilityto a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Overrides:
- setIfLargerin class- Probability<T>
- Parameters:
- probability- The- Probabilityto assign.
 
- 
isLargerDescription copied from class:ProbabilityChecks if a probability is greater than the old one.- Overrides:
- isLargerin class- Probability<T>
- Parameters:
- probability- the probability to check
- Returns:
- trueif a probability is greater than the old one,- falseotherwise.
 
- 
setLogpublic void setLog(double probability) Assigns a logprobabilityto a label, discarding any previously assigned probability.- Overrides:
- setLogin class- Probability<T>
- Parameters:
- probability- The log probability to assign.
 
- 
addInpublic void addIn(double probability) Compounds the existingprobabilitymass on the label with the new probability passed in to the method.- Overrides:
- addInin class- Probability<T>
- Parameters:
- probability- The probability weight to add.
 
- 
get- Overrides:
- getin class- Probability<T>
- Returns:
- Retrieves the probability associated with a label.
 
- 
getLog- Overrides:
- getLogin class- Probability<T>
- Returns:
- Retrieves the log probability associated with a label.
 
- 
getLabel- Overrides:
- getLabelin class- Probability<T>
- Returns:
- Retrieves the probabilities associated with all labels,
 
- 
toString- Overrides:
- toStringin class- Probability<T>
 
 
-