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

Method BObserver

src/com/winvector/variables/BObserver.java:137–156  ·  view source on GitHub ↗
(final Set<String> varsToEncode, final VariableEncodings oldAdapter, 
			final DModel<ExampleRow> sigmoidLoss, final double[] oldX)

Source from the content-addressed store, hash-verified

135
136
137 public BObserver(final Set<String> varsToEncode, final VariableEncodings oldAdapter,
138 final DModel<ExampleRow> sigmoidLoss, final double[] oldX) {
139 this.oldAdapter = oldAdapter;
140 this.sigmoidLoss = sigmoidLoss;
141 this.oldX = oldX;
142 this.noutcomes = oldAdapter.noutcomes();
143 smallValue = 0.1/(double)noutcomes;
144 // build a quick list to access stats we are interested in
145 final Map<String,VariableMapping> oldAdaptions = new HashMap<String,VariableMapping>();
146 for(final VariableMapping oldAdaption: oldAdapter.adaptions) {
147 oldAdaptions.put(oldAdaption.origColumn(),oldAdaption);
148 }
149 for(final String variable: varsToEncode) {
150 stats.put(variable,new BStat(oldAdaptions.get(variable)));
151 }
152 pred = new double[noutcomes];
153 if(null==sigmoidLoss) {
154 Arrays.fill(pred,1.0/(double)noutcomes);
155 }
156 }
157
158 @Override
159 public void observe(final BurstMap row) {

Callers

nothing calls this directly

Calls 3

noutcomesMethod · 0.65
origColumnMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected