class PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> {

    PMMLRuntime getPMMLRuntime(final String kModulePackageName, final KieBase knowledgeBase,
                                       final String containerModelName) {
        final String key = containerModelName + "_" + kModulePackageName;
        InternalKnowledgeBase kieBase = MAPPED_KIEBASES.computeIfAbsent(key, s -> {
            final KiePackage kiePackage = knowledgeBase.getKiePackage(kModulePackageName);
            final List<KiePackage> packages = kiePackage != null ? Collections.singletonList(knowledgeBase.getKiePackage(kModulePackageName)) : Collections.emptyList();
            RuleBaseConfiguration conf = new RuleBaseConfiguration();
            conf.setClassLoader(((KnowledgeBaseImpl) knowledgeBase).getRootClassLoader());
            InternalKnowledgeBase toReturn = KnowledgeBaseFactory.newKnowledgeBase(kModulePackageName, conf);
            toReturn.addPackages(packages);
            return toReturn;
        });
        KieRuntimeFactory kieRuntimeFactory = KieRuntimeFactory.of(kieBase);
        return kieRuntimeFactory.get(PMMLRuntime.class);
    }

}