public static KiePMMLClassificationTable getClassificationTable(final RegressionCompilationDTO compilationDTO) {
        logger.trace("getClassificationTable {}", compilationDTO);
        final LinkedHashMap<String, KiePMMLRegressionTable> categoryTableMap =
                KiePMMLRegressionTableFactory.getRegressionTables(compilationDTO);
        boolean isBinary = compilationDTO.isBinary(categoryTableMap.size());
        final SerializableFunction<LinkedHashMap<String, Double>,
                LinkedHashMap<String, Double>> probabilityMapFunction = getProbabilityMapFunction(compilationDTO.getModelNormalizationMethod(), isBinary);

        return KiePMMLClassificationTable.builder(UUID.randomUUID().toString(), Collections.emptyList())
                .withRegressionNormalizationMethod(compilationDTO.getDefaultREGRESSION_NORMALIZATION_METHOD())
                .withOpType(compilationDTO.getOP_TYPE())
                .withCategoryTableMap(categoryTableMap)
                .withProbabilityMapFunction(probabilityMapFunction)
                .withIsBinary(isBinary)
                .withTargetField(compilationDTO.getTargetFieldName())
                .build();
    }
@Test
    void getClassificationTable() {
        RegressionTable regressionTableProf = getRegressionTable(3.5, "professional");
        RegressionTable regressionTableCler = getRegressionTable(27.4, "clerical");
        OutputField outputFieldCat = getOutputField("CAT-1", ResultFeature.PROBABILITY, "CatPred-1");
        OutputField outputFieldNum = getOutputField("NUM-1", ResultFeature.PROBABILITY, "NumPred-0");
        OutputField outputFieldPrev = getOutputField("PREV", ResultFeature.PREDICTED_VALUE, null);

        String targetField = "targetField";
        DataField dataField = new DataField();
        dataField.setName(targetField);
        dataField.setOpType(OpType.CATEGORICAL);
        DataDictionary dataDictionary = new DataDictionary();
        dataDictionary.addDataFields(dataField);
        RegressionModel regressionModel = new RegressionModel();
        regressionModel.setNormalizationMethod(RegressionModel.NormalizationMethod.CAUCHIT);
        regressionModel.addRegressionTables(regressionTableProf, regressionTableCler);
        regressionModel.setModelName(getGeneratedClassName("RegressionModel"));
        Output output = new Output();
        output.addOutputFields(outputFieldCat, outputFieldNum, outputFieldPrev);
        regressionModel.setOutput(output);
        MiningField targetMiningField = new MiningField();
        targetMiningField.setUsageType(MiningField.UsageType.TARGET);
        targetMiningField.setName(dataField.getName());
        MiningSchema miningSchema = new MiningSchema();
        miningSchema.addMiningFields(targetMiningField);
        regressionModel.setMiningSchema(miningSchema);
        PMML pmml = new PMML();
        pmml.setDataDictionary(dataDictionary);
        pmml.addModels(regressionModel);
        final CommonCompilationDTO<RegressionModel> source =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                       pmml,
                                                                       regressionModel,
                                                                       new PMMLCompilationContextMock(),
                                                                       "FILENAME");
        final RegressionCompilationDTO compilationDTO =
                RegressionCompilationDTO.fromCompilationDTORegressionTablesAndNormalizationMethod(source,
                                                                                                  regressionModel.getRegressionTables(),
                                                                                                  regressionModel.getNormalizationMethod());
        KiePMMLClassificationTable retrieved =
                KiePMMLClassificationTableFactory.getClassificationTable(compilationDTO);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getCategoryTableMap()).hasSameSizeAs(regressionModel.getRegressionTables());
        regressionModel.getRegressionTables().forEach(regressionTable ->
                assertThat(retrieved.getCategoryTableMap()).containsKey(regressionTable.getTargetCategory().toString()));
        assertThat(retrieved.getRegressionNormalizationMethod().getName()).isEqualTo(regressionModel.getNormalizationMethod().value());
        assertThat(retrieved.getOpType()).isEqualTo(OP_TYPE.CATEGORICAL);
        boolean isBinary = regressionModel.getRegressionTables().size() == 2;
        assertThat(retrieved.isBinary()).isEqualTo(isBinary);
        assertThat(retrieved.isBinary()).isEqualTo(isBinary);
        assertThat(retrieved.getTargetField()).isEqualTo(targetMiningField.getName());
    }