public class CaRuleGeneration
extends weka.associations.RuleGeneration
implements java.io.Serializable
The implementation follows the paper expect for adding a rule to the output of the n<\i> best rules. A rule is added if: the expected predictive accuracy of this rule is among the n<\i> best and it is not subsumed by a rule with at least the same expected predictive accuracy (out of an unpublished manuscript from T. Scheffer).
Constructor and Description |
---|
CaRuleGeneration(weka.associations.ItemSet itemSet)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
aSubsumesB(weka.associations.RuleItem a,
weka.associations.RuleItem b)
Methods that decides whether or not rule a subsumes rule b.
|
java.util.TreeSet |
generateRules(int numRules,
double[] midPoints,
java.util.Hashtable priors,
double expectation,
weka.core.Instances instances,
java.util.TreeSet best,
int genTime)
Generates all rules for an item set.
|
static weka.core.FastVector |
singleConsequence(weka.core.Instances instances)
generates a consequence of length 1 for a class association rule.
|
static weka.core.FastVector |
singletons(weka.core.Instances instances)
Converts the header info of the given set of instances into a set
of item sets (singletons).
|
public CaRuleGeneration(weka.associations.ItemSet itemSet)
itemSet
- the item set that forms the premise of the rulepublic java.util.TreeSet generateRules(int numRules, double[] midPoints, java.util.Hashtable priors, double expectation, weka.core.Instances instances, java.util.TreeSet best, int genTime)
generateRules
in class weka.associations.RuleGeneration
numRules
- the number of association rules the use wants to mine.
This number equals the size n<\i> of the list of the
best rules.midPoints
- the mid points of the intervalspriors
- Hashtable that contains the prior probabilitiesexpectation
- the minimum value of the expected predictive accuracy
that is needed to get into the list of the best rulesinstances
- the instances for which association rules are generatedbest
- the list of the n<\i> best rules.
The list is implemented as a TreeSetgenTime
- the maximum time of generationpublic static boolean aSubsumesB(weka.associations.RuleItem a, weka.associations.RuleItem b)
a
- an association rule stored as a RuleItemb
- an association rule stored as a RuleItempublic static weka.core.FastVector singletons(weka.core.Instances instances) throws java.lang.Exception
instances
- the set of instances whose header info is to be usedjava.lang.Exception
- if singletons can't be generated successfullypublic static weka.core.FastVector singleConsequence(weka.core.Instances instances)
instances
- the instances under consideration