public class CaRuleGeneration extends RuleGeneration implements java.io.Serializable, RevisionHandler
The implementation follows the paper expect for adding a rule to the output of the n best rules. A rule is added if: the expected predictive accuracy of this rule is among the n 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(ItemSet itemSet)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
aSubsumesB(RuleItem a,
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,
Instances instances,
java.util.TreeSet best,
int genTime)
Generates all rules for an item set.
|
java.lang.String |
getRevision()
Returns the revision string.
|
static FastVector |
singleConsequence(Instances instances)
generates a consequence of length 1 for a class association rule.
|
static FastVector |
singletons(Instances instances)
Converts the header info of the given set of instances into a set
of item sets (singletons).
|
binomialDistribution, change, count, expectation, removeRedundant, singleConsequence
public CaRuleGeneration(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, Instances instances, java.util.TreeSet best, int genTime)
generateRules
in class RuleGeneration
numRules
- the number of association rules the use wants to mine.
This number equals the size n 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 best rules.
The list is implemented as a TreeSetgenTime
- the maximum time of generationpublic static boolean aSubsumesB(RuleItem a, RuleItem b)
a
- an association rule stored as a RuleItemb
- an association rule stored as a RuleItempublic static FastVector singletons(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 FastVector singleConsequence(Instances instances)
instances
- the instances under considerationpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class RuleGeneration