T - The type of items.public class AssociationRule<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Collection<T> |
conclusion
The conclusion of the rule.
|
private java.util.Collection<T> |
premise
The premise of the rule.
|
| Constructor and Description |
|---|
AssociationRule()
Creates a new empty association rule.
|
AssociationRule(java.util.Collection<T> premise,
java.util.Collection<T> conclusion)
Creates a new association rule with the given premise
and conclusion
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToConclusion(T t)
Adds the given object to the conclusion.
|
boolean |
addToPremise(T t)
Adds the given object to the premise.
|
double |
confidence(java.util.Collection<java.util.Collection<T>> database)
Returns the confidence of this rule wrt.
|
java.util.Collection<T> |
getConclusion()
Returns the conclusion of this rule.
|
java.util.Collection<T> |
getPremise()
Returns the premise of this rule.
|
double |
support(java.util.Collection<java.util.Collection<T>> database)
Returns the support of this rule wrt.
|
static <S> double |
support(java.util.Collection<S> itemset,
java.util.Collection<java.util.Collection<S>> database)
Returns the support of the given itemset wrt.
|
static <S> double |
support(S item,
java.util.Collection<java.util.Collection<S>> database)
Returns the support of the given item wrt.
|
java.lang.String |
toString() |
private java.util.Collection<T> premise
private java.util.Collection<T> conclusion
public boolean addToPremise(T t)
t - some objectpublic boolean addToConclusion(T t)
t - some objectpublic java.util.Collection<T> getPremise()
public java.util.Collection<T> getConclusion()
public static <S> double support(S item,
java.util.Collection<java.util.Collection<S>> database)
item - some objectdatabase - a database (set of sets of objects)public static <S> double support(java.util.Collection<S> itemset,
java.util.Collection<java.util.Collection<S>> database)
itemset - some set of objectsdatabase - a database (set of sets of objects)public double support(java.util.Collection<java.util.Collection<T>> database)
database - some set of transactions.public double confidence(java.util.Collection<java.util.Collection<T>> database)
database - some set of transactions.public java.lang.String toString()
toString in class java.lang.Object