public class AssociationRule extends Rule
This class gives a representation for an association rule.
A rule is composed of a premise and a conclusion that are comparable sets, i.e. sets of elements that can be sorted by the lectic order defined by class ComparableSet
. An association rule extends regular rule with the notion of support and confidence. The confidence represents the number of observations for which the rule is true. The support represents the minimum number of observations for the rule to be relevant.
do we use composition over inheritance?
Constructor and Description |
---|
AssociationRule()
Constructs a new empty Rule with a empty premise and an empty conclusion.
|
AssociationRule(SortedSet<Comparable> premise,
SortedSet<Comparable> conclusion)
Constructs a new Rule with the premise and the conclusion given in parameters.
|
AssociationRule(SortedSet<Comparable> premise,
SortedSet<Comparable> conclusion,
double support,
double confidence)
Constructs a new Rule with the premise, the conclusion, the confidence and the support given in parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
getConfidence()
Returns the confidence value of the rule.
|
double |
getSupport()
Returns the support value of the rule.
|
void |
setConfidence(double confidence)
Set the confidence value of the rule.
|
void |
setSupport(double support)
Set the support value of the rule.
|
String |
toString()
Returns a String representation of this component.
|
addAllToConclusion, addAllToPremise, addToConclusion, addToPremise, compareTo, equals, getConclusion, getPremise, hashCode, removeAllFromConclusion, removeAllFromPremise, removeFromConclusion, removeFromPremise
public AssociationRule()
Constructs a new empty Rule with a empty premise and an empty conclusion.
public AssociationRule(SortedSet<Comparable> premise, SortedSet<Comparable> conclusion)
Constructs a new Rule with the premise and the conclusion given in parameters.
premise
- a set of indexed elementsconclusion
- a set of indexed elementspublic AssociationRule(SortedSet<Comparable> premise, SortedSet<Comparable> conclusion, double support, double confidence)
Constructs a new Rule with the premise, the conclusion, the confidence and the support given in parameters.
premise
- a set of indexed elementsconclusion
- a set of indexed elementssupport
- a support valueconfidence
- a confidence valuepublic final double getConfidence()
Returns the confidence value of the rule.
public final double getSupport()
Returns the support value of the rule.
public final void setConfidence(double confidence)
Set the confidence value of the rule.
confidence
- the confidence valuepublic final void setSupport(double support)
Set the support value of the rule.
support
- the support valueCopyright © 2010–2016 The Galactic Organization. All rights reserved.