public class LabeledItemSet extends ItemSet implements Serializable, RevisionHandler
| Constructor and Description |
|---|
LabeledItemSet(int totalTrans,
int classLabel)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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(Object itemSet)
Compares two item sets
|
boolean |
equals(Object itemSet)
Tests if two item sets are equal.
|
FastVector[] |
generateRules(double minConfidence,
boolean noPrune)
Generates rules out of item sets
|
static Hashtable |
getHashtable(FastVector itemSets,
int initialSize)
Return a hashtable filled with the given item sets.
|
String |
getRevision()
Returns the revision string.
|
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,
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
|
containedBy, counter, getTreatZeroAsMissing, hashCode, itemAt, items, pruneRules, setCounter, setItem, setItemAt, setTreatZeroAsMissing, singletons, toString, upDateCounter, upDateCounterspublic LabeledItemSet(int totalTrans,
int classLabel)
totalTrans - the total number of transactionsclassLabel - the class lebelpublic 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 coveredpublic final boolean equals(Object itemSet)
public final boolean equalCondset(Object itemSet)
itemSet - an item setpublic static 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 hashtablepublic 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 Exception
instances - the instancesinvert - flag; if true only the class attribute remains, otherweise the class attribute is the only attribute that is deleted.Exception - exception if instances cannot be splittedpublic static FastVector singletons(Instances instancesNoClass, Instances classes) throws Exception
instancesNoClass - instances without the class attributeclasses - the values of the class attribute sorted according to instancesException - if singletons can't be generated successfullypublic static FastVector pruneItemSets(FastVector toPrune, Hashtable kMinusOne)
toPrune - the set of (k)-item sets to be prunedkMinusOne - the (k-1)-item sets to be used for pruningpublic final int support()
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 valuepublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class ItemSetCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.