KiePMMLRegressionClassificationTable extends KiePMMLRegressionTable { protected abstract LinkedHashMap<String, Double> getProbabilityMap(final LinkedHashMap<String, Double> resultMap);  @Override Object evaluateRegression(Map<String, Object> input); abstract boolean isBinary(); REGRESSION_NORMALIZATION_METHOD getRegressionNormalizationMethod(); OP_TYPE getOpType(); Map<String, KiePMMLRegressionTable> getCategoryTableMap();  }
@Test public void getProbabilityMap() { LinkedHashMap<String, Double> resultMap = new LinkedHashMap<>(); resultMap.put(CASE_B, firstTableResult); resultMap.put(CASE_A, secondTableResult); LinkedHashMap<String, Double> retrieved = classificationTable.getProbabilityMap(resultMap, FIRST_ITEM_OPERATOR, SECOND_ITEM_OPERATOR); double expectedDouble = FIRST_ITEM_OPERATOR.applyAsDouble(firstTableResult); assertEquals(expectedDouble, retrieved.get(CASE_B), 0.0); expectedDouble = SECOND_ITEM_OPERATOR.applyAsDouble(expectedDouble); assertEquals(expectedDouble, retrieved.get(CASE_A), 0.0); }
@Test(expected = KiePMMLException.class) public void getProbabilityMapFewInput() { LinkedHashMap<String, Double> resultMap = new LinkedHashMap<>(); resultMap.put(CASE_B, firstTableResult); classificationTable.getProbabilityMap(resultMap, FIRST_ITEM_OPERATOR, SECOND_ITEM_OPERATOR); }
@Test(expected = KiePMMLException.class) public void getProbabilityMapTooManyInput() { LinkedHashMap<String, Double> resultMap = new LinkedHashMap<>(); resultMap.put(CASE_B, firstTableResult); resultMap.put(CASE_A, secondTableResult); resultMap.put("CASE_ELSE", 444.1); classificationTable.getProbabilityMap(resultMap, FIRST_ITEM_OPERATOR, SECOND_ITEM_OPERATOR); }