|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.ItemSet
weka.associations.LabeledItemSet
Class for storing a set of items together with a class label. Item sets are stored in a lexicographic order, which is determined by the header information of the set of instances used for generating the set of items. All methods in this class assume that item sets are stored in lexicographic order. The class provides the methods used for item sets in class association rule mining. Because every item set knows its class label the training set can be splitted up virtually.
Constructor Summary | |
LabeledItemSet(int totalTrans,
int classLabel)
Constructor |
Method Summary | |
static FastVector |
deleteItemSets(FastVector itemSets,
int minSupport,
int maxSupport)
Deletes all item sets that don't have minimum support and have more than maximum support |
static Instances |
divide(Instances instances,
boolean invert)
Splits the class attribute away. |
boolean |
equalCondset(java.lang.Object itemSet)
Compares two item sets |
boolean |
equals(java.lang.Object itemSet)
Tests if two item sets are equal. |
FastVector[] |
generateRules(double minConfidence,
boolean noPrune)
Generates rules out of item sets |
static java.util.Hashtable |
getHashtable(FastVector itemSets,
int initialSize)
Return a hashtable filled with the given item sets. |
static FastVector |
mergeAllItemSets(FastVector 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 FastVector |
pruneItemSets(FastVector toPrune,
java.util.Hashtable kMinusOne)
Prunes a set of (k)-item sets using the given (k-1)-item sets. |
static FastVector |
singletons(Instances instancesNoClass,
Instances classes)
Converts the header info of the given set of instances into a set of item sets (singletons). |
int |
support()
Outputs the support for an item set. |
void |
upDateCounter(Instance instanceNoClass,
Instance instanceClass)
Updates counter of item set with respect to given transaction. |
static void |
upDateCounters(FastVector itemSets,
Instances instancesNoClass,
Instances instancesClass)
Updates counter of a specific item set |
Methods inherited from class weka.associations.ItemSet |
containedBy, counter, hashCode, itemAt, items, pruneRules, setCounter, setItem, setItemAt, singletons, toString, upDateCounter, upDateCounters |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LabeledItemSet(int totalTrans, int classLabel)
totalTrans
- the total number of transactionsclassLabel
- the class lebelMethod Detail |
public static FastVector deleteItemSets(FastVector itemSets, int minSupport, int maxSupport)
maxSupport
- the maximum supportitemSets
- the set of item sets to be prunedminSupport
- the minimum number of transactions to be covered
public final boolean equals(java.lang.Object itemSet)
equals
in class ItemSet
itemSet
- another item set
public final boolean equalCondset(java.lang.Object itemSet)
itemSet
- an item set
public static java.util.Hashtable getHashtable(FastVector itemSets, int initialSize)
itemSets
- the set of item sets to be used for filling the hash tableinitialSize
- the initial size of the hashtable
public static FastVector mergeAllItemSets(FastVector itemSets, int size, int totalTrans)
totalTrans
- the total number of transactionsitemSets
- the set of (k-1)-item setssize
- the value of (k-1)
public static Instances divide(Instances instances, boolean invert) throws java.lang.Exception
instances
- the instancesinvert
- flag; if true only the class attribute remains, otherweise the class attribute is the only attribute that is deleted.
java.lang.Exception
- exception if instances cannot be splittedpublic static FastVector singletons(Instances instancesNoClass, Instances classes) throws java.lang.Exception
instancesNoClass
- instances without the class attributeclasses
- the values of the class attribute sorted according to instances
java.lang.Exception
- if singletons can't be generated successfullypublic static FastVector pruneItemSets(FastVector toPrune, java.util.Hashtable kMinusOne)
toPrune
- the set of (k)-item sets to be prunedkMinusOne
- the (k-1)-item sets to be used for pruning
public final int support()
support
in class ItemSet
public final void upDateCounter(Instance instanceNoClass, Instance instanceClass)
instanceNoClass
- instances without the class attributeinstanceClass
- the values of the class attribute sorted according to instancespublic static void upDateCounters(FastVector itemSets, Instances instancesNoClass, Instances instancesClass)
itemSets
- an item setsinstancesNoClass
- instances without the class attributeinstancesClass
- the values of the class attribute sorted according to instancespublic final FastVector[] generateRules(double minConfidence, boolean noPrune)
minConfidence
- the minimum confidencenoPrune
- flag indicating whether the rules are pruned accoridng to the minimum confidence value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |