Package opennlp.tools.ml.naivebayes
Klasse Probabilities<T>
java.lang.Object
opennlp.tools.ml.naivebayes.Probabilities<T>
- Typparameter:
T
- The label (category) class.
- Bekannte direkte Unterklassen:
LogProbabilities
Class implementing the probability distribution over labels returned by a classifier.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Compounds the existing probability mass on the labelt
with the new probability passed in to the method.void
discardCountsBelow
(double i) getAll()
double
getKeys()
getMax()
double
void
Assigns a probability to a labelt
, discarding any previously assigned probability.void
set
(T t, Probability<T> probability) Assigns a probability to a labelt
, discarding any previously assigned probability.void
setConfidence
(double confidence) Sets the best confidence with which this set of probabilities has been calculated.void
setIfLarger
(T t, double probability) Assigns a probability to a labelt
, discarding any previously assigned probability, if the new probability is greater than the old one.void
Assigns a log probability to a labelt
, discarding any previously assigned probability.toString()
-
Konstruktordetails
-
Probabilities
public Probabilities()
-
-
Methodendetails
-
set
Assigns a probability to a labelt
, discarding any previously assigned probability.- Parameter:
t
- The label to which the probability is being assigned.probability
- The probability to assign.
-
set
Assigns a probability to a labelt
, discarding any previously assigned probability.- Parameter:
t
- The label to which the probability is being assigned.probability
- The probability to assign.
-
setIfLarger
Assigns a probability to a labelt
, discarding any previously assigned probability, if the new probability is greater than the old one.- Parameter:
t
- The label to which the probability is being assigned.probability
- The probability to assign.
-
setLog
Assigns a log probability to a labelt
, discarding any previously assigned probability.- Parameter:
t
- The label to which the log probability is being assigned.probability
- The log probability to assign.
-
addIn
Compounds the existing probability mass on the labelt
with the new probability passed in to the method.- Parameter:
t
- The label whose probability mass is being updated.probability
- The probability weight to add.count
- The amplifying factor for the probability compounding.
-
get
- Parameter:
t
- The label whose probability needs to be returned.- Gibt zurück:
- Retrieves the probability associated with the label.
-
getLog
- Parameter:
t
- The label whose log probability should be returned.- Gibt zurück:
- Retrieves the log probability associated with the label
-
getKeys
- Gibt zurück:
- Retrieves the probabilities associated with all labels
-
getAll
- Gibt zurück:
- Retrieves a
Map
of labels and their probabilities
-
getMax
- Gibt zurück:
- Retrieves the label that has the highest associated probability.
-
getMaxValue
public double getMaxValue()- Gibt zurück:
- Retrieves the probability of the most likely label
-
discardCountsBelow
public void discardCountsBelow(double i) -
getConfidence
public double getConfidence()- Gibt zurück:
- Retrieves the best confidence with which this set of probabilities has been calculated. This is a function of the amount of data that supports the assertion. It is also a measure of the accuracy of the estimator of the probability.
-
setConfidence
public void setConfidence(double confidence) Sets the best confidence with which this set of probabilities has been calculated. This is a function of the amount of data that supports the assertion. It is also a measure of the accuracy of the estimator of the probability.- Parameter:
confidence
- The confidence in the probabilities.
-
toString
-