class PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> {

    PMML4Result getPMML4Result(final KiePMMLMiningModel toEvaluate,
                    final LinkedHashMap<String, KiePMMLNameValue> inputData) {
        final MULTIPLE_MODEL_METHOD multipleModelMethod = toEvaluate.getSegmentation().getMultipleModelMethod();
        Object prediction = null;
        ResultCode resultCode = OK;
        try {
            prediction = multipleModelMethod.apply(inputData);
        } catch (KieEnumException e) {
            logger.warn(e.getMessage());
            resultCode = FAIL;
        }
        PMML4Result toReturn = new PMML4Result();
        toReturn.addResultVariable(toEvaluate.getTargetField(), prediction);
        toReturn.setResultObjectName(toEvaluate.getTargetField());
        toReturn.setResultCode(resultCode.getName());
        toEvaluate.getOutputFieldsMap().forEach(toReturn::addResultVariable);
        return toReturn;
    }

}