class KiePMMLRegressionTableClassificationFactory {

    public static Map.Entry<String, String> getRegressionTable(final LinkedHashMap<String, KiePMMLTableSourceCategory> regressionTablesMap, final RegressionModel.NormalizationMethod normalizationMethod, final OpType opType, final List<KiePMMLOutputField> outputFields, final String targetField, final String packageName) {
        logger.trace("getRegressionTable {}", regressionTablesMap);
        String className = "KiePMMLRegressionTableClassification" + classArity.addAndGet(1);
        CompilationUnit cloneCU = JavaParserUtils.getKiePMMLModelCompilationUnit(className, packageName,
                                                                                 KIE_PMML_REGRESSION_TABLE_CLASSIFICATION_TEMPLATE_JAVA, KIE_PMML_REGRESSION_TABLE_CLASSIFICATION_TEMPLATE);
        ClassOrInterfaceDeclaration tableTemplate = cloneCU.getClassByName(className)
                .orElseThrow(() -> new KiePMMLException(MAIN_CLASS_NOT_FOUND + ": " + className));
        final REGRESSION_NORMALIZATION_METHOD regressionNormalizationMethod =
                REGRESSION_NORMALIZATION_METHOD.byName(normalizationMethod.value());
        final OP_TYPE opTypePmml = opType != null ? OP_TYPE.byName(opType.value()) : null;
        populateGetProbabilityMapMethod(normalizationMethod, tableTemplate);
        populateOutputFieldsMap(tableTemplate, outputFields);
        populateIsBinaryMethod(opType, regressionTablesMap.size(), tableTemplate);
        final ConstructorDeclaration constructorDeclaration =
                tableTemplate.getDefaultConstructor().orElseThrow(() -> new KiePMMLInternalException(String.format(MISSING_DEFAULT_CONSTRUCTOR, tableTemplate.getName())));
        setConstructor(constructorDeclaration, tableTemplate.getName(), targetField, regressionNormalizationMethod,
                       opTypePmml);
        addMapPopulation(constructorDeclaration.getBody(), regressionTablesMap);
        populateGetTargetCategory(tableTemplate, null);
        return new AbstractMap.SimpleEntry<>(getFullClassName(cloneCU), cloneCU.toString());
    }

    private  KiePMMLRegressionTableClassificationFactory();

}