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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIn
(double probability) Compounds the existingprobability
mass on the label with the new probability passed in to the method.get()
getLabel()
getLog()
boolean
isLarger
(Probability<T> probability) Checks if a probability is greater than the old one.void
set
(double probability) Assigns aprobability
to a label, discarding any previously assigned probability.void
set
(Probability<T> probability) Assigns aprobability
to a label, discarding any previously assigned probability.void
setIfLarger
(double probability) Assigns aprobability
to a label, discarding any previously assigned probability, if the new probability is greater than the old one.void
setIfLarger
(Probability<T> probability) Assigns aprobability
to a label, discarding any previously assigned probability, if the new probability is greater than the old one.void
setLog
(double probability) Assigns a logprobability
to a label, discarding any previously assigned probability.toString()
-
Constructor Details
-
LogProbability
-
-
Method Details
-
set
public void set(double probability) Assigns aprobability
to a label, discarding any previously assigned probability.- Overrides:
set
in classProbability<T>
- Parameters:
probability
- The probability to assign.
-
set
Assigns aprobability
to a label, discarding any previously assigned probability.- Overrides:
set
in classProbability<T>
- Parameters:
probability
- TheProbability
to assign.
-
setIfLarger
public void setIfLarger(double probability) Assigns aprobability
to a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Overrides:
setIfLarger
in classProbability<T>
- Parameters:
probability
- The probability to assign.
-
setIfLarger
Assigns aprobability
to a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Overrides:
setIfLarger
in classProbability<T>
- Parameters:
probability
- TheProbability
to assign.
-
isLarger
Description copied from class:Probability
Checks if a probability is greater than the old one.- Overrides:
isLarger
in classProbability<T>
- Parameters:
probability
- the probability to check- Returns:
true
if a probability is greater than the old one,false
otherwise.
-
setLog
public void setLog(double probability) Assigns a logprobability
to a label, discarding any previously assigned probability.- Overrides:
setLog
in classProbability<T>
- Parameters:
probability
- The log probability to assign.
-
addIn
public void addIn(double probability) Compounds the existingprobability
mass on the label with the new probability passed in to the method.- Overrides:
addIn
in classProbability<T>
- Parameters:
probability
- The probability weight to add.
-
get
- Overrides:
get
in classProbability<T>
- Returns:
- Retrieves the probability associated with a label.
-
getLog
- Overrides:
getLog
in classProbability<T>
- Returns:
- Retrieves the log probability associated with a label.
-
getLabel
- Overrides:
getLabel
in classProbability<T>
- Returns:
- Retrieves the probabilities associated with all labels,
-
toString
- Overrides:
toString
in classProbability<T>
-