类 LabeledItemSet
java.lang.Object
weka.associations.ItemSet
weka.associations.LabeledItemSet
- 所有已实现的接口:
Serializable
,RevisionHandler
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.
- 版本:
- $Revision: 1.5 $
- 作者:
- Stefan Mutter (mutter@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static FastVector
deleteItemSets
(FastVector itemSets, int minSupport, int maxSupport) Deletes all item sets that don't have minimum support and have more than maximum supportstatic Instances
Splits the class attribute away.final boolean
equalCondset
(Object itemSet) Compares two item setsfinal boolean
Tests if two item sets are equal.final FastVector[]
generateRules
(double minConfidence, boolean noPrune) Generates rules out of item setsstatic Hashtable
getHashtable
(FastVector itemSets, int initialSize) Return a hashtable filled with the given item sets.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).final int
support()
Outputs the support for an item set.final 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从类继承的方法 weka.associations.ItemSet
containedBy, counter, hashCode, itemAt, items, pruneRules, setCounter, setItem, setItemAt, singletons, toString, upDateCounter, upDateCounters
-
构造器详细资料
-
LabeledItemSet
public LabeledItemSet(int totalTrans, int classLabel) Constructor- 参数:
totalTrans
- the total number of transactionsclassLabel
- the class lebel
-
-
方法详细资料
-
deleteItemSets
Deletes all item sets that don't have minimum support and have more than maximum support- 参数:
maxSupport
- the maximum supportitemSets
- the set of item sets to be prunedminSupport
- the minimum number of transactions to be covered- 返回:
- the reduced set of item sets
-
equals
Tests if two item sets are equal. -
equalCondset
Compares two item sets- 参数:
itemSet
- an item set- 返回:
- true if the the item sets are equal, false otherwise
-
getHashtable
Return a hashtable filled with the given item sets.- 参数:
itemSets
- the set of item sets to be used for filling the hash tableinitialSize
- the initial size of the hashtable- 返回:
- the generated hashtable
-
mergeAllItemSets
Merges all item sets in the set of (k-1)-item sets to create the (k)-item sets and updates the counters.- 参数:
totalTrans
- the total number of transactionsitemSets
- the set of (k-1)-item setssize
- the value of (k-1)- 返回:
- the generated (k)-item sets
-
divide
Splits the class attribute away. Depending on the invert flag, the instances without class attribute or only the class attribute of all instances is returned- 参数:
instances
- the instancesinvert
- flag; if true only the class attribute remains, otherweise the class attribute is the only attribute that is deleted.- 返回:
- Instances without the class attribute or instances with only the class attribute
- 抛出:
Exception
- exception if instances cannot be splitted
-
singletons
Converts the header info of the given set of instances into a set of item sets (singletons). The ordering of values in the header file determines the lexicographic order. Each item set knows its class label.- 参数:
instancesNoClass
- instances without the class attributeclasses
- the values of the class attribute sorted according to instances- 返回:
- a set of item sets, each containing a single item
- 抛出:
Exception
- if singletons can't be generated successfully
-
pruneItemSets
Prunes a set of (k)-item sets using the given (k-1)-item sets.- 参数:
toPrune
- the set of (k)-item sets to be prunedkMinusOne
- the (k-1)-item sets to be used for pruning- 返回:
- the pruned set of item sets
-
support
public final int support()Outputs the support for an item set. -
upDateCounter
Updates counter of item set with respect to given transaction.- 参数:
instanceNoClass
- instances without the class attributeinstanceClass
- the values of the class attribute sorted according to instances
-
upDateCounters
public static void upDateCounters(FastVector itemSets, Instances instancesNoClass, Instances instancesClass) Updates counter of a specific item set- 参数:
itemSets
- an item setsinstancesNoClass
- instances without the class attributeinstancesClass
- the values of the class attribute sorted according to instances
-
generateRules
Generates rules out of item sets- 参数:
minConfidence
- the minimum confidencenoPrune
- flag indicating whether the rules are pruned accoridng to the minimum confidence value- 返回:
- a set of rules
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中ItemSet
- 返回:
- the revision
-