Package opennlp.tools.ml.naivebayes
Klasse Probability<T>
java.lang.Object
opennlp.tools.ml.naivebayes.Probability<T>
- Typparameter:
T- The label (category) class.
- Bekannte direkte Unterklassen:
LogProbability
Class implementing the probability for a label.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddIn(double probability) Compounds the existing probability mass 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 a probability to a label, discarding any previously assigned probability.voidset(Probability<T> probability) Assigns a probability to a label, discarding any previously assigned probability.voidsetIfLarger(double probability) Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.voidsetIfLarger(Probability<T> probability) Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.voidsetLog(double probability) Assigns a log probability to a label, discarding any previously assigned probability.toString()
-
Konstruktordetails
-
Probability
Instantiates aProbabilitywith a givenlabel.- Parameter:
label- Thelabelto assign probabilities to.
-
-
Methodendetails
-
set
public void set(double probability) Assigns a probability to a label, discarding any previously assigned probability.- Parameter:
probability- The probability to assign.
-
set
Assigns a probability to a label, discarding any previously assigned probability.- Parameter:
probability- The probability to assign.
-
setIfLarger
public void setIfLarger(double probability) Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Parameter:
probability- The probability to assign.
-
setIfLarger
Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.- Parameter:
probability- The probability to assign.
-
isLarger
Checks if a probability is greater than the old one.- Parameter:
probability- The probability to assign.- Gibt zurück:
trueif a probability is greater than the old one,falseotherwise.
-
setLog
public void setLog(double probability) Assigns a log probability to a label, discarding any previously assigned probability.- Parameter:
probability- The log probability to assign.
-
addIn
public void addIn(double probability) Compounds the existing probability mass on the label with the new probability passed in to the method.- Parameter:
probability- The probability weight to add.
-
get
- Gibt zurück:
- Retrieves the probability associated with a label.
-
getLog
- Gibt zurück:
- Retrieves the log probability associated with a label.
-
getLabel
- Gibt zurück:
- Retrieves the probabilities associated with all labels.
-
toString
-