|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.classify.Probability
public class Probability
Wraps a probability. Optionally also wraps a "pR" value that can be used to decide between probabilities that are very similar (e.g. ~1.0), because it is less sensitive to rounding issues. Instance of this class are immutable and thus thread-safe.
Constructor Summary | |
---|---|
Probability(double theProb)
Creates a new instance, setting the pR to Double.NaN (unknown). |
|
Probability(double theProb,
double thePR)
Creates a new instance. |
Method Summary | |
---|---|
double |
getPR()
Returns the optional pR: pR = log(p / (1-p)); or Double.NaN if not known/not relevant. |
double |
getProb()
Returns the actual probability; will be in value in the range from 0 to 1; or -1 if the actual value is unknown/not applicable. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Probability(double theProb)
Double.NaN
(unknown).
theProb
- the probability of the prediction (must be in the range
from 0.0 to 1.0; or -1 if this is a confirmed prediction or an answer
key)public Probability(double theProb, double thePR)
theProb
- the probability of the prediction (must be in the range
from 0.0 to 1.0; or -1 if this is a confirmed prediction or an answer
key)thePR
- the pR of the prediction;
or Double.NaN
if not knownMethod Detail |
---|
public double getPR()
Double.NaN
if not known/not relevant.
public double getProb()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |