use of org.dmg.pmml.RuleSetModelDocument.RuleSetModel in project knime-core by knime.
the class PMMLRuleTranslator method initializeFrom.
/**
* {@inheritDoc}
*/
@Override
public void initializeFrom(final PMMLDocument pmmlDoc) {
m_nameMapper = new DerivedFieldMapper(pmmlDoc);
List<RuleSetModel> models = pmmlDoc.getPMML().getRuleSetModelList();
if (models.size() == 0) {
throw new IllegalArgumentException("No treemodel provided.");
}
m_originalRuleModel = models.get(0);
initDataDictionary(pmmlDoc);
m_rules = parseRulesFromModel(m_originalRuleModel);
MININGFUNCTION.Enum functionName = m_originalRuleModel.getFunctionName();
assert functionName == MININGFUNCTION.CLASSIFICATION : functionName;
m_isScorable = m_originalRuleModel.getIsScorable();
RuleSet ruleSet = m_originalRuleModel.getRuleSet();
m_selectionMethodList = ruleSet.getRuleSelectionMethodList();
m_defaultScore = ruleSet.isSetDefaultScore() ? ruleSet.getDefaultScore() : null;
m_defaultConfidence = ruleSet.isSetDefaultConfidence() ? ruleSet.getDefaultConfidence() : Double.NaN;
m_recordCount = ruleSet.isSetRecordCount() ? ruleSet.getRecordCount() : Double.NaN;
m_nbCorrect = ruleSet.isSetNbCorrect() ? ruleSet.getNbCorrect() : Double.NaN;
}
Aggregations