public class AprioriItemSet extends ItemSet implements Serializable, RevisionHandler
| Constructor and Description |
|---|
AprioriItemSet(int totalTrans)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static double |
confidenceForRule(AprioriItemSet premise,
AprioriItemSet consequence)
Outputs the confidence for a rule.
|
double |
convictionForRule(AprioriItemSet premise,
AprioriItemSet consequence,
int premiseCount,
int consequenceCount)
Outputs the conviction for a rule.
|
ArrayList<Object>[] |
generateRules(double minConfidence,
ArrayList<Hashtable<ItemSet,Integer>> hashtables,
int numItemsInSet)
Generates all rules for an item set.
|
ArrayList<Object>[] |
generateRulesBruteForce(double minMetric,
int metricType,
ArrayList<Hashtable<ItemSet,Integer>> hashtables,
int numItemsInSet,
int numTransactions,
double significanceLevel)
Generates all significant rules for an item set.
|
String |
getRevision()
Returns the revision string.
|
double |
leverageForRule(AprioriItemSet premise,
AprioriItemSet consequence,
int premiseCount,
int consequenceCount)
Outputs the leverage for a rule.
|
double |
liftForRule(AprioriItemSet premise,
AprioriItemSet consequence,
int consequenceCount)
Outputs the lift for a rule.
|
static ArrayList<Object> |
mergeAllItemSets(ArrayList<Object> itemSets,
int size,
int totalTrans)
Merges all item sets in the set of (k-1)-item sets to create the (k)-item
sets and updates the counters.
|
static ArrayList<Object> |
singletons(Instances instances,
boolean treatZeroAsMissing)
Converts the header info of the given set of instances into a set of item
sets (singletons).
|
AprioriItemSet |
subtract(AprioriItemSet toSubtract)
Subtracts an item set from another one.
|
String |
toString(Instances instances)
Returns the contents of an item set as a string.
|
containedBy, containedByTreatZeroAsMissing, counter, deleteItemSets, equals, getHashtable, hashCode, itemAt, items, pruneItemSets, pruneRules, setCounter, setItem, setItemAt, singletons, support, toString, upDateCounter, upDateCounters, upDateCountersTreatZeroAsMissing, updateCounterTreatZeroAsMissingpublic AprioriItemSet(int totalTrans)
totalTrans - the total number of transactions in the datapublic static double confidenceForRule(AprioriItemSet premise, AprioriItemSet consequence)
premise - the premise of the ruleconsequence - the consequence of the rulepublic double liftForRule(AprioriItemSet premise, AprioriItemSet consequence, int consequenceCount)
premise - the premise of the ruleconsequence - the consequence of the ruleconsequenceCount - how many times the consequence occurs independent
of the premisepublic double leverageForRule(AprioriItemSet premise, AprioriItemSet consequence, int premiseCount, int consequenceCount)
premise - the premise of the ruleconsequence - the consequence of the rulepremiseCount - how many times the premise occurs independent of the
consequentconsequenceCount - how many times the consequence occurs independent
of the premisepublic double convictionForRule(AprioriItemSet premise, AprioriItemSet consequence, int premiseCount, int consequenceCount)
premise - the premise of the ruleconsequence - the consequence of the rulepremiseCount - how many times the premise occurs independent of the
consequentconsequenceCount - how many times the consequence occurs independent
of the premisepublic ArrayList<Object>[] generateRules(double minConfidence, ArrayList<Hashtable<ItemSet,Integer>> hashtables, int numItemsInSet)
minConfidence - the minimum confidence the rules have to havehashtables - containing all(!) previously generated item setsnumItemsInSet - the size of the item set for which the rules are to be
generatedpublic final ArrayList<Object>[] generateRulesBruteForce(double minMetric, int metricType, ArrayList<Hashtable<ItemSet,Integer>> hashtables, int numItemsInSet, int numTransactions, double significanceLevel) throws Exception
minMetric - the minimum metric (confidence, lift, leverage,
improvement) the rules have to havemetricType - (confidence=0, lift, leverage, improvement)hashtables - containing all(!) previously generated item setsnumItemsInSet - the size of the item set for which the rules are to be
generatednumTransactions - significanceLevel - the significance level for testing the rulesException - if something goes wrongpublic final AprioriItemSet subtract(AprioriItemSet toSubtract)
toSubtract - the item set to be subtracted from this one.public final String toString(Instances instances)
public static ArrayList<Object> singletons(Instances instances, boolean treatZeroAsMissing) throws Exception
instances - the set of instances whose header info is to be usedException - if singletons can't be generated successfullypublic static ArrayList<Object> mergeAllItemSets(ArrayList<Object> itemSets, int size, int totalTrans)
itemSets - the set of (k-1)-item setssize - the value of (k-1)totalTrans - the total number of transactions in the datapublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class ItemSetCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.