|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwpi.associations.arminerSequence.AssociationRule
AssociationRule.java
An association rule has two parts: the antecedent of the rule and the consequent of the rule, both of which are sets of items. Associated with these are a support and a confidence. The support tells how many rows of a database support this rule, the confidence tells what percentage of the rows that contain the antecedent also contain the consequent.
Field Summary | |
private int[] |
antecedent
The antecedent. |
static int |
ANTECEDENT_SIZE
|
private float |
antecedentEventWeight
The event weight of the antecedent of association rule. |
private float |
antecedentSupport
The support of the antecedent of association rule. |
private float |
confidence
The confidence of the association rule. |
static int |
CONFIDENCE
|
private int[] |
consequent
The consequent. |
static int |
CONSEQUENT_SIZE
|
private float |
consequentEventWeight
The event weight of the consequent of association rule. |
private float |
consequentSupport
The support of the consequent of association rule. |
private static int |
debug
Specifies debug info level 0: no debug info 1: input to methods 2: and output from methods 3: and all sorts of stuff |
private int |
numInstances
Number of instances in the data set. |
ARMinerItemset |
originalItemset
the original item set the rule's antecedent and consequent were derived from |
private float |
ruleEventWeight
The event weight of the association rule. |
private float |
support
The support of the association rule. |
static int |
SUPPORT
|
Constructor Summary | |
AssociationRule(ARMinerItemset antecedent,
ARMinerItemset consequent,
ARMinerItemset original,
float support,
float confidence)
Creates a new association rule. |
Method Summary | |
boolean |
antecedentHasEvents()
Checks if there is at least one event in the antecedent. |
int |
antecedentSize()
Return size of antecedent. |
int |
compareTo(AssociationRule ar,
int criteria)
Compare two AssociationRule objects on one of several criteria. |
boolean |
consequentHasEvents()
Checks if there is at least one event in the consequent. |
int |
consequentSize()
Return size of consequent. |
int[] |
countEventWeights(ARMinerItemset itemset)
Counts the number of occurrences of the antecedent and the number of occurrences of the consequent in context of the antecedents found in the specified item set. |
boolean |
equals(java.lang.Object obj)
Compare two AssociationRule objects on one of several criteria. |
float |
eventWeightConfidence()
Calculates and records confidence of association rule based on antecedent event weight and overall association rule event weight in context of the antecedent. |
float |
getAntecedentEventWeight()
Return event weight of antecedent of association rule. |
int |
getAntecedentItem(int i)
Return i-th item in antecedent. |
float |
getAntecedentSupport()
Return support of antecedent of association rule. |
float |
getChiSquare()
Calculates and returns the Chi-square measure of the rule. |
float |
getConfidence()
Return confidence of association rule. |
float |
getConsequentEventWeight()
Return event weight of consequent of association rule. |
int |
getConsequentItem(int i)
Return i-th item in consequent. |
float |
getConsequentSupport()
Return support of antecedent of association rule. |
float |
getLift()
Return lift of association rule. |
int |
getNumInstances()
Returns the number of instances contained in the data set from which the frequent item set were mined. |
float |
getRuleEventWeight()
Return event weight of association rule. |
float |
getSupport()
Return support of association rule. |
static void |
main(java.lang.String[] args)
Main method for testing purposes only. |
void |
resetEventWeights()
Resets the event weight count to zero. |
void |
setNumInstances(int n)
Sets the number of instances contained in the data set from which the frequent item set were mined. |
java.lang.String |
toString()
Return a String representation of the AssociationRule. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ANTECEDENT_SIZE
public static final int CONSEQUENT_SIZE
public static final int SUPPORT
public static final int CONFIDENCE
private int[] antecedent
private int[] consequent
private float support
private float antecedentSupport
private float consequentSupport
private float antecedentEventWeight
private float consequentEventWeight
private float ruleEventWeight
private float confidence
private int numInstances
public ARMinerItemset originalItemset
private static final int debug
Constructor Detail |
public AssociationRule(ARMinerItemset antecedent, ARMinerItemset consequent, ARMinerItemset original, float support, float confidence)
antecedent
- the antecedent of the association ruleconsequent
- the consequent of the association ruleoriginal
- the original item set the antecedent and consequent
were derived fromsupport
- the support of the association ruleconfidence
- the confidence of the association rule
java.lang.IllegalArgumentException
- antecedent
or consequent
are null or support
or confidence
are not between 0 and 1Method Detail |
public void setNumInstances(int n)
n
- the number of instances or rowspublic int getNumInstances()
public int antecedentSize()
public int consequentSize()
public float getSupport()
public float getAntecedentSupport()
public float getConsequentSupport()
public float getAntecedentEventWeight()
public float getConsequentEventWeight()
public float getRuleEventWeight()
public float getConfidence()
public float eventWeightConfidence()
public float getLift()
public float getChiSquare()
public boolean consequentHasEvents()
public boolean antecedentHasEvents()
public int getAntecedentItem(int i)
i
- the index of the item to get
i
-th item in antecedent
java.lang.IndexOutOfBoundsException
- i
is an invalid indexpublic int getConsequentItem(int i)
i
- the index of the item to get
i
-th item in consequent
java.lang.IndexOutOfBoundsException
- i
is an invalid indexpublic int compareTo(AssociationRule ar, int criteria)
ar
- the AssociationRule object with which we want to
compare this objectcriteria
- the criteria on which we want to compare, can
be one of ANTECEDENT_SIZE, CONSEQUENT_SIZE, SUPPORT
or CONFIDENCE.
ar
, 0 if they are equal, and a positive
value if this object is greater.
java.lang.IllegalArgumentException
- ar
is null or criteria is invalidpublic boolean equals(java.lang.Object obj)
obj
- the object to compare for equality
public int[] countEventWeights(ARMinerItemset itemset)
itemset
- the item set to find occurrences of the antecedent and
consequent in
public void resetEventWeights()
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |