|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rapidminer.tools.AbstractObservable<Operator>
com.rapidminer.operator.Operator
com.rapidminer.operator.learner.AbstractLearner
com.rapidminer.operator.learner.rules.BestRuleInduction
public class BestRuleInduction
This operator returns the best rule regarding WRAcc using exhaustive search. Features like the incorporation of other metrics and the search for more than a single rule are prepared. The search strategy is BFS, with save pruning whenever applicable. This operator can easily be extended to support other search strategies.
Nested Class Summary | |
---|---|
static class |
BestRuleInduction.RuleWithScoreUpperBound
Helper class containing a rule and an upper bound for the score. |
Field Summary | |
---|---|
protected ConjunctiveRuleModel |
bestRule
|
Fields inherited from interface com.rapidminer.operator.learner.CapabilityProvider |
---|
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN |
Constructor Summary | |
---|---|
BestRuleInduction(OperatorDescription description)
|
Method Summary | |
---|---|
protected boolean |
communicateToHighscore(ConjunctiveRuleModel rule,
double[] counts)
Adds a rule to the set of best rules if its score is high enough. |
protected ConjunctiveRuleModel |
getBestRule()
|
protected double[] |
getCounts(ConjunctiveRuleModel rule,
ExampleSet exampleSet)
|
java.lang.Class<? extends PredictionModel> |
getModelClass()
This method might be overridden from subclasses in order to specify exactly which model class they use. |
protected double |
getOptimisticScore(double[] counts)
Computes the best possible score that might be achieved by refining the rule. |
java.util.List<ParameterType> |
getParameterTypes()
Adds the parameters "number of iterations" and "model file". |
protected double |
getPruningScore()
|
protected double |
getScore(double[] counts,
boolean predictPositives)
Computes the WRAcc or BINOMIAL TEST FUNCTION based on p, n, and the global values P and N stored in this object. |
protected void |
initHighscore()
|
boolean |
isRefinementOfPrunedRule(ConjunctiveRuleModel rule)
|
Model |
learn(ExampleSet exampleSet)
Trains a model. |
boolean |
supportsCapability(OperatorCapability lc)
Checks for Learner capabilities. |
Methods inherited from class com.rapidminer.operator.learner.AbstractLearner |
---|
canCalculateWeights, canEstimatePerformance, doWork, doWork, getEstimatedPerformance, getExampleSetInputPort, getOptimizationPerformance, getWeightCalculationError, getWeights, getWeights, onlyWarnForNonSufficientCapabilities, shouldAutoConnect, shouldCalculateWeights, shouldDeliverOptimizationPerformance, shouldEstimatePerformance |
Methods inherited from class com.rapidminer.tools.AbstractObservable |
---|
addObserver, addObserverAsFirst, fireUpdate, removeObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rapidminer.operator.learner.Learner |
---|
getName |
Field Detail |
---|
protected ConjunctiveRuleModel bestRule
Constructor Detail |
---|
public BestRuleInduction(OperatorDescription description)
Method Detail |
---|
public boolean supportsCapability(OperatorCapability lc)
CapabilityProvider
protected void initHighscore()
protected boolean communicateToHighscore(ConjunctiveRuleModel rule, double[] counts) throws UndefinedParameterError
UndefinedParameterError
protected ConjunctiveRuleModel getBestRule()
protected double getPruningScore()
public Model learn(ExampleSet exampleSet) throws OperatorException
Learner
OperatorException
public boolean isRefinementOfPrunedRule(ConjunctiveRuleModel rule)
rule
- a ConjuctiveRuleModel for which it is checked whether a more
general rule has already been pruned.
ConjunctiveRuleModel.isRefinementOf(ConjunctiveRuleModel model)
protected double getScore(double[] counts, boolean predictPositives) throws UndefinedParameterError
UndefinedParameterError
protected double getOptimisticScore(double[] counts) throws UndefinedParameterError
UndefinedParameterError
protected double[] getCounts(ConjunctiveRuleModel rule, ExampleSet exampleSet) throws OperatorException
rule
- the rule to evaluateexampleSet
- the exampleSet to get the counts for
OperatorException
public java.lang.Class<? extends PredictionModel> getModelClass()
AbstractLearner
getModelClass
in class AbstractLearner
public java.util.List<ParameterType> getParameterTypes()
getParameterTypes
in interface ParameterHandler
getParameterTypes
in class Operator
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |