|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwpi.associations.arminer.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 |
confidence
The confidence of the association rule. |
static int |
CONFIDENCE
|
private int[] |
consequent
The consequent. |
static int |
CONSEQUENT_SIZE
|
private float |
support
The support of the association rule. |
static int |
SUPPORT
|
Constructor Summary | |
AssociationRule(ARMinerItemset antecedent,
ARMinerItemset consequent,
float support,
float confidence)
Creates a new association rule. |
Method Summary | |
int |
antecedentSize()
Return size of antecedent. |
int |
compareTo(AssociationRule ar,
int criteria)
Compare two AssociationRule objects on one of several criteria. |
int |
consequentSize()
Return size of consequent. |
boolean |
equals(java.lang.Object obj)
Compare two AssociationRule objects on one of several criteria. |
int |
getAntecedentItem(int i)
Return i-th item in antecedent. |
float |
getConfidence()
Return confidence of association rule. |
int |
getConsequentItem(int i)
Return i-th item in consequent. |
float |
getSupport()
Return support of association rule. |
static void |
main(java.lang.String[] args)
for testing purposes only !!! |
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 confidence
Constructor Detail |
public AssociationRule(ARMinerItemset antecedent, ARMinerItemset consequent, float support, float confidence)
antecedent
- the antecedent of the association ruleconsequent
- the consequent of the association rulesupport
- 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 int antecedentSize()
public int consequentSize()
public float getSupport()
public float getConfidence()
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)
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 |