public class LabeledItemSet extends ItemSet implements java.io.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(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.
|
java.lang.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,
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
|
containedBy, counter, hashCode, itemAt, items, pruneRules, setCounter, setItem, setItemAt, singletons, toString, upDateCounter, upDateCounters
public 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(java.lang.Object itemSet)
public final boolean equalCondset(java.lang.Object itemSet)
itemSet
- an item setpublic 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 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 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 instancesjava.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 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 java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ItemSet