Package opennlp.tools.ml.naivebayes
Klasse LogProbabilities<T>
java.lang.Object
opennlp.tools.ml.naivebayes.Probabilities<T>
opennlp.tools.ml.naivebayes.LogProbabilities<T>
- Typparameter:
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.
- Siehe auch:
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Compounds the existingprobability
mass on the labelt
with the new probability passed in to the method.void
discardCountsBelow
(double i) getAll()
getMax()
void
Assigns aprobability
to a labelt
, discarding any previously assigned probability.void
set
(T t, Probability<T> probability) Assigns aprobability
to a labelt
, discarding any previously assigned probability.void
setIfLarger
(T t, double probability) Assigns aprobability
to a labelt
, discarding any previously assigned probability, if the new probability is greater than the old one.void
Assigns a logprobability
to a labelt
, discarding any previously assigned probability.Von Klasse geerbte Methoden opennlp.tools.ml.naivebayes.Probabilities
getConfidence, getKeys, getMaxValue, setConfidence, toString
-
Konstruktordetails
-
LogProbabilities
public LogProbabilities()
-
-
Methodendetails
-
set
Assigns aprobability
to a labelt
, discarding any previously assigned probability.- Setzt außer Kraft:
set
in KlasseProbabilities<T>
- Parameter:
t
- The label to which the probability is being assigned.probability
- The probability to assign.
-
set
Assigns aprobability
to a labelt
, discarding any previously assigned probability.- Setzt außer Kraft:
set
in KlasseProbabilities<T>
- Parameter:
t
- The label to which the probability is being assigned.probability
- TheProbability<T>
to assign.
-
setIfLarger
Assigns aprobability
to a labelt
, discarding any previously assigned probability, if the new probability is greater than the old one.- Setzt außer Kraft:
setIfLarger
in KlasseProbabilities<T>
- Parameter:
t
- The label to which the probability is being assigned.probability
- The probability to assign.
-
setLog
Assigns a logprobability
to a labelt
, discarding any previously assigned probability.- Setzt außer Kraft:
setLog
in KlasseProbabilities<T>
- Parameter:
t
- The label to which the log probability is being assigned.probability
- The logprobability
to assign.
-
addIn
Compounds the existingprobability
mass on the labelt
with the new probability passed in to the method.- Setzt außer Kraft:
addIn
in KlasseProbabilities<T>
- Parameter:
t
- The label whoseprobability
mass is being updated.probability
- The probability weight to add.count
- The amplifying factor for theprobability
compounding.
-
get
- Setzt außer Kraft:
get
in KlasseProbabilities<T>
- Parameter:
t
- The label whose probability shall be returned.- Gibt zurück:
- Retrieves the probability associated with the label
t
.
-
getLog
- Setzt außer Kraft:
getLog
in KlasseProbabilities<T>
- Parameter:
t
- The label whose log probability shall be returned.- Gibt zurück:
- Retrieves the log probability associated with the label
t
.
-
discardCountsBelow
public void discardCountsBelow(double i) - Setzt außer Kraft:
discardCountsBelow
in KlasseProbabilities<T>
-
getAll
- Setzt außer Kraft:
getAll
in KlasseProbabilities<T>
- Gibt zurück:
- Retrieves a
Map
of all labels and their probabilities.
-
getMax
- Setzt außer Kraft:
getMax
in KlasseProbabilities<T>
- Gibt zurück:
- Retrieves the label that has the highest associated probability
-