public class CaRuleGeneration extends RuleGeneration implements 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.
|
TreeSet |
generateRules(int numRules,
double[] midPoints,
Hashtable priors,
double expectation,
Instances instances,
TreeSet best,
int genTime)
Generates all rules for an item set.
|
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, singleConsequencepublic CaRuleGeneration(ItemSet itemSet)
itemSet - the item set that forms the premise of the rulepublic TreeSet generateRules(int numRules, double[] midPoints, Hashtable priors, double expectation, Instances instances, TreeSet best, int genTime)
generateRules in class RuleGenerationnumRules - 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 Exception
instances - the set of instances whose header info is to be usedException - if singletons can't be generated successfullypublic static FastVector singleConsequence(Instances instances)
instances - the instances under considerationpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class RuleGenerationCopyright © 2021 University of Waikato, Hamilton, NZ. All rights reserved.