public class LabeledItemSet
extends weka.associations.ItemSet
implements java.io.Serializable
| Constructor and Description |
|---|
LabeledItemSet(int totalTrans,
int classLabel)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static weka.core.FastVector |
deleteItemSets(weka.core.FastVector itemSets,
int minSupport,
int maxSupport)
Deletes all item sets that don't have minimum support and have more than maximum support
|
static weka.core.Instances |
divide(weka.core.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.
|
weka.core.FastVector[] |
generateRules(double minConfidence,
boolean noPrune)
Generates rules out of item sets
|
static java.util.Hashtable |
getHashtable(weka.core.FastVector itemSets,
int initialSize)
Return a hashtable filled with the given item sets.
|
static weka.core.FastVector |
mergeAllItemSets(weka.core.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 weka.core.FastVector |
pruneItemSets(weka.core.FastVector toPrune,
java.util.Hashtable kMinusOne)
Prunes a set of (k)-item sets using the given (k-1)-item sets.
|
static weka.core.FastVector |
singletons(weka.core.Instances instancesNoClass,
weka.core.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(weka.core.Instance instanceNoClass,
weka.core.Instance instanceClass)
Updates counter of item set with respect to given transaction.
|
static void |
upDateCounters(weka.core.FastVector itemSets,
weka.core.Instances instancesNoClass,
weka.core.Instances instancesClass)
Updates counter of a specific item set
|
containedBy, containedByTreatZeroAsMissing, counter, deleteItemSets, getHashtable, getItems, getRevision, getTotalTransactions, hashCode, itemAt, items, mergeAllItemSets, pruneItemSets, pruneRules, setCounter, setItem, setItemAt, singletons, toString, toString, upDateCounter, upDateCounters, upDateCountersTreatZeroAsMissing, updateCounterTreatZeroAsMissingpublic LabeledItemSet(int totalTrans,
int classLabel)
totalTrans - the total number of transactionsclassLabel - the class lebelpublic static weka.core.FastVector deleteItemSets(weka.core.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)
equals in class weka.associations.ItemSetitemSet - another item setpublic final boolean equalCondset(java.lang.Object itemSet)
itemSet - an item setpublic static java.util.Hashtable getHashtable(weka.core.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 weka.core.FastVector mergeAllItemSets(weka.core.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 weka.core.Instances divide(weka.core.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 weka.core.FastVector singletons(weka.core.Instances instancesNoClass,
weka.core.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 weka.core.FastVector pruneItemSets(weka.core.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()
support in class weka.associations.ItemSetpublic final void upDateCounter(weka.core.Instance instanceNoClass,
weka.core.Instance instanceClass)
instanceNoClass - instances without the class attributeinstanceClass - the values of the class attribute sorted according to instancespublic static void upDateCounters(weka.core.FastVector itemSets,
weka.core.Instances instancesNoClass,
weka.core.Instances instancesClass)
itemSets - an item setsinstancesNoClass - instances without the class attributeinstancesClass - the values of the class attribute sorted according to instancespublic final weka.core.FastVector[] generateRules(double minConfidence,
boolean noPrune)
minConfidence - the minimum confidencenoPrune - flag indicating whether the rules are pruned accoridng to the minimum confidence value