KiePMMLRegressionClassificationTable extends KiePMMLRegressionTable { @Override public Object evaluateRegression(Map<String, Object> input) { final LinkedHashMap<String, Double> resultMap = new LinkedHashMap<>(); for (Map.Entry<String, KiePMMLRegressionTable> entry : categoryTableMap.entrySet()) { resultMap.put(entry.getKey(), (Double) entry.getValue().evaluateRegression(input)); } final LinkedHashMap<String, Double> probabilityMap = getProbabilityMap(resultMap); final Map.Entry<String, Double> predictedEntry = Collections.max(probabilityMap.entrySet(), Map.Entry.comparingByValue()); probabilityMap.put(targetField, predictedEntry.getValue()); populateOutputFieldsMapWithResult(predictedEntry.getKey()); populateOutputFieldsMapWithProbability(predictedEntry, probabilityMap); return predictedEntry.getKey(); }  @Override Object evaluateRegression(Map<String, Object> input); abstract boolean isBinary(); REGRESSION_NORMALIZATION_METHOD getRegressionNormalizationMethod(); OP_TYPE getOpType(); Map<String, KiePMMLRegressionTable> getCategoryTableMap();  }
@Test public void evaluateRegression() { Map<String, Object> input = new HashMap<>(); input.put("a", 24); input.put("b", 32); Object retrieved = classificationTable.evaluateRegression(input); assertEquals(expectedResult, retrieved); final Map<String, Object> outputFieldsMap = classificationTable.getOutputFieldsMap(); double expectedDouble = FIRST_ITEM_OPERATOR.applyAsDouble(firstTableResult); assertEquals(expectedDouble, outputFieldsMap.get(PROBABILITY_FALSE)); expectedDouble = SECOND_ITEM_OPERATOR.applyAsDouble(expectedDouble); assertEquals(expectedDouble, outputFieldsMap.get(PROBABILITY_TRUE)); }