|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.ItemSet
Class for storing a set of items. 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 general methods used for item sets in class - and standard association rule mining.
Constructor Summary | |
ItemSet(int totalTrans)
Constructor |
|
ItemSet(int[] array)
Contsructor |
|
ItemSet(int totalTrans,
int[] array)
Constructor |
Method Summary | |
boolean |
containedBy(Instance instance)
Checks if an instance contains an item set. |
int |
counter()
Gets the counter |
static FastVector |
deleteItemSets(FastVector itemSets,
int minSupport,
int maxSupport)
Deletes all item sets that don't have minimum support. |
boolean |
equals(java.lang.Object itemSet)
Tests if two item sets are equal. |
static java.util.Hashtable |
getHashtable(FastVector itemSets,
int initialSize)
Return a hashtable filled with the given item sets. |
int |
hashCode()
Produces a hash code for a item set. |
int |
itemAt(int k)
Gest the index of the value of the specified attribute |
int[] |
items()
Gest the item set as an int array |
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 void |
pruneRules(FastVector[] rules,
double minConfidence)
Prunes a set of rules. |
void |
setCounter(int count)
Sets the counter |
void |
setItem(int[] items)
Sets an item sets |
void |
setItemAt(int value,
int k)
Sets the index of an attribute value |
static FastVector |
singletons(Instances instances)
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. |
java.lang.String |
toString(Instances instances)
Returns the contents of an item set as a string. |
void |
upDateCounter(Instance instance)
Updates counter of item set with respect to given transaction. |
static void |
upDateCounters(FastVector itemSets,
Instances instances)
Updates counters for a set of item sets and a set of instances. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ItemSet(int totalTrans)
totalTrans
- the total number of transactions in the datapublic ItemSet(int totalTrans, int[] array)
totalTrans
- the total number of transactions in the dataarray
- the attribute values encoded in an int arraypublic ItemSet(int[] array)
array
- the item set represented as an int arrayMethod Detail |
public final boolean containedBy(Instance instance)
instance
- the instance to be tested
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 boolean equals(java.lang.Object itemSet)
itemSet
- another 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 final int hashCode()
public static FastVector mergeAllItemSets(FastVector itemSets, int size, int totalTrans)
totalTrans
- thetotal number of transactionsitemSets
- the set of (k-1)-item setssize
- the value of (k-1)
public 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 static void pruneRules(FastVector[] rules, double minConfidence)
rules
- a two-dimensional array of lists of item sets. The first list
of item sets contains the premises, the second one the consequences.minConfidence
- the minimum confidence the rules have to havepublic static FastVector singletons(Instances instances) throws java.lang.Exception
instances
- the set of instances whose header info is to be used
java.lang.Exception
- if singletons can't be generated successfullypublic int support()
public java.lang.String toString(Instances instances)
instances
- contains the relevant header information
public void upDateCounter(Instance instance)
instance
- the instance to be used for ubdating the counterpublic static void upDateCounters(FastVector itemSets, Instances instances)
itemSets
- the set of item sets which are to be updatedinstances
- the instances to be used for updating the counterspublic int counter()
public int[] items()
public int itemAt(int k)
k
- the attribute index
public void setCounter(int count)
count
- the counterpublic void setItem(int[] items)
items
- an int array representing an item setpublic void setItemAt(int value, int k)
value
- the inex of the attribute valuek
- the index of the attribute
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |