public static KiePMMLRegressionModel getKiePMMLRegressionModelClasses(final RegressionCompilationDTO compilationDTO) throws IOException, IllegalAccessException, InstantiationException {
        logger.trace("getKiePMMLRegressionModelClasses {} {}", compilationDTO.getFields(), compilationDTO.getModel());
        Map<String, AbstractKiePMMLTable> regressionTablesMap = getRegressionTables(compilationDTO);
        try {
            AbstractKiePMMLTable nestedTable = regressionTablesMap.size() == 1 ?
                    regressionTablesMap.values().iterator().next() :
                    regressionTablesMap.values().stream().filter(KiePMMLClassificationTable.class::isInstance)
                            .findFirst()
                            .orElseThrow(() -> new KiePMMLException("Failed to find expected " +
                                                                            KiePMMLClassificationTable.class.getSimpleName()));

            return KiePMMLRegressionModel.builder(compilationDTO.getFileName(), compilationDTO.getModelName(), compilationDTO.getMINING_FUNCTION())
                    .withAbstractKiePMMLTable(nestedTable)
                    .withTargetField(compilationDTO.getTargetFieldName())
                    .withMiningFields(compilationDTO.getKieMiningFields())
                    .withOutputFields(compilationDTO.getKieOutputFields())
                    .withKiePMMLMiningFields(compilationDTO.getKiePMMLMiningFields())
                    .withKiePMMLOutputFields(compilationDTO.getKiePMMLOutputFields())
                    .withKiePMMLTargets(compilationDTO.getKiePMMLTargetFields())
                    .withKiePMMLTransformationDictionary(compilationDTO.getKiePMMLTransformationDictionary())
                    .withKiePMMLLocalTransformations(compilationDTO.getKiePMMLLocalTransformations())
                    .build();
        } catch (Exception e) {
            throw new KiePMMLException(e);
        }
    }
@Test
    void getKiePMMLRegressionModelClasses() throws IOException, IllegalAccessException, InstantiationException {
        final CompilationDTO<RegressionModel> compilationDTO =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                       pmml,
                                                                       regressionModel,
                                                                       new PMMLCompilationContextMock(),
                                                                       "FILENAME");
        KiePMMLRegressionModel retrieved =
                KiePMMLRegressionModelFactory.getKiePMMLRegressionModelClasses(RegressionCompilationDTO.fromCompilationDTO(compilationDTO));
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getName()).isEqualTo(regressionModel.getModelName());
        assertThat(retrieved.getMiningFunction()).isEqualTo(MINING_FUNCTION.byName(regressionModel.getMiningFunction().value()));
        assertThat(retrieved.getTargetField()).isEqualTo(miningFields.get(0).getName());
        final AbstractKiePMMLTable regressionTable = retrieved.getRegressionTable();
        assertThat(regressionTable).isNotNull();
        assertThat(regressionTable).isInstanceOf(KiePMMLClassificationTable.class);
        evaluateCategoricalRegressionTable((KiePMMLClassificationTable) regressionTable);
    }