T
- the label (category) classpublic class Probability<T> extends Object
Constructor and Description |
---|
Probability(T label) |
Modifier and Type | Method and Description |
---|---|
void |
addIn(double probability)
Compounds the existing probability mass on the label with the new probability passed in to the method.
|
Double |
get()
Returns the probability associated with a label
|
T |
getLabel()
Returns the probabilities associated with all labels
|
Double |
getLog()
Returns the log probability associated with a label
|
boolean |
isLarger(Probability probability)
Checks if a probability is greater than the old one.
|
void |
set(double probability)
Assigns a probability to a label, discarding any previously assigned probability.
|
void |
set(Probability probability)
Assigns a probability to a label, discarding any previously assigned probability.
|
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.
|
void |
setIfLarger(Probability probability)
Assigns a probability to a label, discarding any previously assigned probability,
if the new probability is greater than the old one.
|
void |
setLog(double probability)
Assigns a log probability to a label, discarding any previously assigned probability.
|
String |
toString() |
public Probability(T label)
public void set(double probability)
probability
- the probability to assignpublic void set(Probability probability)
probability
- the probability to assignpublic void setIfLarger(double probability)
probability
- the probability to assignpublic void setIfLarger(Probability probability)
probability
- the probability to assignpublic boolean isLarger(Probability probability)
probability
- the probability to assignpublic void setLog(double probability)
probability
- the log probability to assignpublic void addIn(double probability)
probability
- the probability weight to addpublic Double get()
public Double getLog()
public T getLabel()
Copyright © 2018 The Apache Software Foundation. All rights reserved.