public static KiePMMLRegressionTable getRegressionTable(final RegressionTable regressionTable,
                                                            final RegressionCompilationDTO compilationDTO) {
        logger.trace("getRegressionTable {}", regressionTable);

        final Map<String, SerializableFunction<Double, Double>> numericPredictorsMap =
                getNumericPredictorsMap(regressionTable.getNumericPredictors());
        final Map<String, SerializableFunction<String, Double>> categoricalPredictorsMap =
                getCategoricalPredictorsMap(regressionTable.getCategoricalPredictors());
        final Map<String, SerializableFunction<Map<String, Object>, Double>> predictorTermFunctionMap =
                getPredictorTermsMap(regressionTable.getPredictorTerms());
        final SerializableFunction<Double, Double> resultUpdater =
                getResultUpdaterFunction(compilationDTO.getDefaultNormalizationMethod());
        final Double intercept = regressionTable.getIntercept() != null ? regressionTable.getIntercept().doubleValue() : null;
        return KiePMMLRegressionTable.builder(UUID.randomUUID().toString(), Collections.emptyList())
                .withNumericFunctionMap(numericPredictorsMap)
                .withCategoricalFunctionMap(categoricalPredictorsMap)
                .withPredictorTermsFunctionMap(predictorTermFunctionMap)
                .withResultUpdater(resultUpdater)
                .withIntercept(intercept)
                .withTargetField(compilationDTO.getTargetFieldName())
                .withTargetCategory(regressionTable.getTargetCategory())
                .build();
    }
@Test
    void getRegressionTable() {
        regressionTable = getRegressionTable(3.5, "professional");
        RegressionModel regressionModel = new RegressionModel();
        regressionModel.setNormalizationMethod(RegressionModel.NormalizationMethod.CAUCHIT);
        regressionModel.addRegressionTables(regressionTable);
        regressionModel.setModelName(getGeneratedClassName("RegressionModel"));
        String targetField = "targetField";
        DataField dataField = new DataField();
        dataField.setName(targetField);
        dataField.setOpType(OpType.CATEGORICAL);
        DataDictionary dataDictionary = new DataDictionary();
        dataDictionary.addDataFields(dataField);
        MiningField miningField = new MiningField();
        miningField.setUsageType(MiningField.UsageType.TARGET);
        miningField.setName(dataField.getName());
        MiningSchema miningSchema = new MiningSchema();
        miningSchema.addMiningFields(miningField);
        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,
                                                                                                  new ArrayList<>(),
                                                                                                  regressionModel.getNormalizationMethod());
        KiePMMLRegressionTable retrieved = KiePMMLRegressionTableFactory.getRegressionTable(regressionTable,
                                                                                            compilationDTO);
        assertThat(retrieved).isNotNull();
        commonEvaluateRegressionTable(retrieved, regressionTable);
    }