(final Set<String> varsToEncode, final VariableEncodings oldAdapter, final DModel<ExampleRow> sigmoidLoss, final double[] oldX)
| 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) { |
nothing calls this directly
no test coverage detected