|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.Counters
Static methods for operating on Counter
s.
Constructor Summary | |
Counters()
|
Method Summary | |
static Counter |
average(Counter c1,
Counter c2)
Returns a new Counter with counts averaged from the two given Counters. |
static double |
cosine(Counter c1,
Counter c2)
|
static Counter |
createCounterFromList(List l)
|
static double |
entropy(Counter c)
Calculates the entropy of the given counter (in bits). |
static Counter |
getCountCounts(Counter c)
|
static double |
informationRadius(Counter c1,
Counter c2)
Calculates the information radius (aka the Jensen-Shannon divergence) between the two Counters. |
static double |
klDivergence(Counter from,
Counter to)
Calculates the KL divergence between the two counters. |
static Counter |
linearCombination(Counter c1,
double w1,
Counter c2,
double w2)
Returns a Counter which is a weighted average of c1 and c2. |
static void |
printCounterComparison(Counter a,
Counter b)
Great for debugging. |
static void |
printCounterComparison(Counter a,
Counter b,
PrintStream out)
Great for debugging. |
static void |
printCounterSortedByKeys(Counter c)
|
static PriorityQueue |
toPriorityQueue(Counter c)
|
static List |
toSortedList(Counter c)
|
static Counter |
union(Counter c1,
Counter c2)
Returns a Counter that is the union of the two Counters passed in (counts are added). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Counters()
Method Detail |
public static Counter union(Counter c1, Counter c2)
c1
- c2
-
public static double entropy(Counter c)
public static double klDivergence(Counter from, Counter to)
from
- to
-
public static double informationRadius(Counter c1, Counter c2)
iRad(p,q) = D(p||(p+q)/2)+D(q,(p+q)/2)where p is one Counter, q is the other counter, and D(p||q) is the KL divergence bewteen p and q. Note that iRad(p,q) = iRad(q,p).
public static double cosine(Counter c1, Counter c2)
public static Counter average(Counter c1, Counter c2)
public static Counter linearCombination(Counter c1, double w1, Counter c2, double w2)
public static Counter createCounterFromList(List l)
public static List toSortedList(Counter c)
public static PriorityQueue toPriorityQueue(Counter c)
public static void printCounterComparison(Counter a, Counter b)
a
- b
- public static void printCounterComparison(Counter a, Counter b, PrintStream out)
a
- b
- public static Counter getCountCounts(Counter c)
public static void printCounterSortedByKeys(Counter c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |