T
- the label (category) classpublic class LogProbabilities<T> extends Probabilities<T>
Constructor and Description |
---|
LogProbabilities() |
Modifier and Type | Method and Description |
---|---|
void |
addIn(T t,
double probability,
int count)
Compounds the existing probability mass on the label with the new probability passed in to the method.
|
void |
discardCountsBelow(double i) |
Double |
get(T t)
Returns the probability associated with a label
|
Map<T,Double> |
getAll()
Returns the probabilities associated with all labels
|
Double |
getLog(T t)
Returns the log probability associated with a label
|
T |
getMax()
Returns the most likely label
|
void |
set(T t,
double probability)
Assigns a probability to a label, discarding any previously assigned probability.
|
void |
set(T t,
Probability<T> probability)
Assigns a probability to a label, discarding any previously assigned probability.
|
void |
setIfLarger(T t,
double probability)
Assigns a probability to a label, discarding any previously assigned probability,
if the new probability is greater than the old one.
|
void |
setLog(T t,
double probability)
Assigns a log probability to a label, discarding any previously assigned probability.
|
getConfidence, getKeys, getMaxValue, setConfidence, toString
public void set(T t, double probability)
set
in class Probabilities<T>
t
- the label to which the probability is being assignedprobability
- the probability to assignpublic void set(T t, Probability<T> probability)
set
in class Probabilities<T>
t
- the label to which the probability is being assignedprobability
- the probability to assignpublic void setIfLarger(T t, double probability)
setIfLarger
in class Probabilities<T>
t
- the label to which the probability is being assignedprobability
- the probability to assignpublic void setLog(T t, double probability)
setLog
in class Probabilities<T>
t
- the label to which the log probability is being assignedprobability
- the log probability to assignpublic void addIn(T t, double probability, int count)
addIn
in class Probabilities<T>
t
- the label whose probability mass is being updatedprobability
- the probability weight to addcount
- the amplifying factor for the probability compoundingpublic Double get(T t)
get
in class Probabilities<T>
t
- the label whose probability needs to be returnedpublic Double getLog(T t)
getLog
in class Probabilities<T>
t
- the label whose log probability needs to be returnedpublic void discardCountsBelow(double i)
discardCountsBelow
in class Probabilities<T>
public Map<T,Double> getAll()
getAll
in class Probabilities<T>
public T getMax()
getMax
in class Probabilities<T>
Copyright © 2021 The Apache Software Foundation. All rights reserved.