本文整理匯總了Java中com.rapidminer.operator.learner.rules.RuleModel類的典型用法代碼示例。如果您正苦於以下問題:Java RuleModel類的具體用法?Java RuleModel怎麽用?Java RuleModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RuleModel類屬於com.rapidminer.operator.learner.rules包,在下文中一共展示了RuleModel類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addRules
import com.rapidminer.operator.learner.rules.RuleModel; //導入依賴的package包/類
private void addRules(RuleModel ruleModel, Rule currentRule, Tree tree) {
if (tree.isLeaf()) {
currentRule.setLabel(tree.getLabel());
int[] frequencies = new int[ruleModel.getLabel().getMapping().size()];
int index = 0;
for (String labelValue : ruleModel.getLabel().getMapping().getValues()) {
frequencies[index++] = tree.getCount(labelValue);
}
currentRule.setFrequencies(frequencies);
ruleModel.addRule(currentRule);
} else {
Iterator<Edge> e = tree.childIterator();
while (e.hasNext()) {
Edge edge = e.next();
SplitCondition condition = edge.getCondition();
Tree child = edge.getChild();
Rule clonedRule = (Rule) currentRule.clone();
clonedRule.addTerm(condition);
addRules(ruleModel, clonedRule, child);
}
}
}
示例2: addRules
import com.rapidminer.operator.learner.rules.RuleModel; //導入依賴的package包/類
private void addRules(RuleModel ruleModel, Rule currentRule, Tree tree) {
if (tree.isLeaf()) {
currentRule.setLabel(tree.getLabel());
int[] frequencies = new int[ruleModel.getLabel().getMapping().size()];
int index = 0;
for (String labelValue : ruleModel.getLabel().getMapping().getValues()) {
frequencies[index++] = tree.getCount(labelValue);
}
currentRule.setFrequencies(frequencies);
ruleModel.addRule(currentRule);
} else {
Iterator<Edge> e = tree.childIterator();
while (e.hasNext()) {
Edge edge = e.next();
SplitCondition condition = edge.getCondition();
Tree child = edge.getChild();
Rule clonedRule = (Rule)currentRule.clone();
clonedRule.addTerm(condition);
addRules(ruleModel, clonedRule, child);
}
}
}