MCPcopy Index your code
hub / github.com/WinVector/Logistic / BSampler

Class BSampler

src/com/winvector/variables/BTable.java:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 public Iterable<BurstMap> sample = null;
34
35 private static final class BSampler implements SerialObserver<BurstMap> {
36 public final VariableEncodings oldAdapter;
37 public final ResevoirSampler<BurstMap> sampler;
38
39 public BSampler(final VariableEncodings oldAdapter, final long randSeed) {
40 this.oldAdapter = oldAdapter;
41 sampler = new ResevoirSampler<BurstMap>(100000,randSeed);
42 }
43
44 @Override
45 public void observe(final BurstMap row) {
46 final double weight = oldAdapter.weight(row);
47 if(weight>0.0) {
48 final String resStr = row.getAsString(oldAdapter.def().resultColumn);
49 final int category = oldAdapter.category(resStr);
50 if(category>=0) {
51 sampler.observe(row);
52 }
53 }
54 }
55 }
56
57
58

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected