MCPcopy Create free account
hub / github.com/WinVector/Logistic / observe

Method observe

src/com/winvector/util/StatMap.java:23–31  ·  view source on GitHub ↗

Invariant: key set calls all keys ever observed (even those with net-zero count)

(final String key, final double x, final double wt)

Source from the content-addressed store, hash-verified

21 * Invariant: key set calls all keys ever observed (even those with net-zero count)
22 */
23 public void observe(final String key, final double x, final double wt) {
24 SimpleStat v = counts.get(key);
25 if(v==null) {
26 v = new SimpleStat();
27 counts.put(key,v);
28 }
29 v.sumW += wt;
30 v.sumWX += wt*x;
31 }
32
33 public void observe(final String key, final SimpleStat val) {
34 SimpleStat v = counts.get(key);

Callers 1

readStatMapMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected