Class AssociationRule<T>
java.lang.Object
org.tweetyproject.machinelearning.assoc.AssociationRule<T>
- Type Parameters:
T
- The type of items.
An association rule in item set mining.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionCreates a new empty association rule.AssociationRule
(Collection<T> premise, Collection<T> conclusion) Creates a new association rule with the given premise and conclusion -
Method Summary
Modifier and TypeMethodDescriptionboolean
addToConclusion
(T t) Adds the given object to the conclusion.boolean
addToPremise
(T t) Adds the given object to the premise.double
confidence
(Collection<Collection<T>> database) Returns the confidence of this rule wrt.Returns the conclusion of this rule.Returns the premise of this rule.double
support
(Collection<Collection<T>> database) Returns the support of this rule wrt.static <S> double
support
(Collection<S> itemset, Collection<Collection<S>> database) Returns the support of the given itemset wrt.static <S> double
support
(S item, Collection<Collection<S>> database) Returns the support of the given item wrt.toString()
-
Constructor Details
-
AssociationRule
public AssociationRule()Creates a new empty association rule. -
AssociationRule
Creates a new association rule with the given premise and conclusion- Parameters:
premise
- some set of objects for the premise.conclusion
- some set of objects for the conclusion.
-
-
Method Details
-
addToPremise
Adds the given object to the premise.- Parameters:
t
- some object- Returns:
- "true" iff this has been changed.
-
addToConclusion
Adds the given object to the conclusion.- Parameters:
t
- some object- Returns:
- "true" iff this has been changed.
-
getPremise
Returns the premise of this rule.- Returns:
- the premise of this rule.
-
getConclusion
Returns the conclusion of this rule.- Returns:
- the conclusion of this rule.
-
support
Returns the support of the given item wrt. the given database, i.e., the number of transactions of the database, which contain the given item, divided by the number of all transactions.- Type Parameters:
S
- the type of objects- Parameters:
item
- some objectdatabase
- a database (set of sets of objects)- Returns:
- the support of the item.
-
support
Returns the support of the given itemset wrt. the given database, i.e., the number of transactions of the database, which contain the given itemset, divided by the number of all transactions.- Type Parameters:
S
- the type of objects- Parameters:
itemset
- some set of objectsdatabase
- a database (set of sets of objects)- Returns:
- the support of the itemset.
-
support
Returns the support of this rule wrt. the given database (a set of transactions), i.e. the support (frequency of occurrences) of the union of premise and conclusion in the database.- Parameters:
database
- some set of transactions.- Returns:
- the support of this rule.
-
confidence
Returns the confidence of this rule wrt. the given database (a set of transactions). More precisely, the support of this rule divided by the support of the premise alone.- Parameters:
database
- some set of transactions.- Returns:
- the confidence of the rule
-
toString
-