public static class FPGrowth.AssociationRule extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<FPGrowth.AssociationRule>
Modifier and Type | Class and Description |
---|---|
static class |
FPGrowth.AssociationRule.METRIC_TYPE
Enum for holding different metric types
|
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_SELECTION
Tags for display in the GUI
|
Constructor and Description |
---|
AssociationRule(java.util.Collection<FPGrowth.BinaryItem> premise,
java.util.Collection<FPGrowth.BinaryItem> consequence,
FPGrowth.AssociationRule.METRIC_TYPE metric,
int premiseSupport,
int consequenceSupport,
int totalSupport,
int totalTransactions)
Construct a new association rule.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(FPGrowth.AssociationRule other)
Compare this rule to the supplied rule.
|
boolean |
containsItems(java.util.ArrayList<Attribute> items,
boolean useOr) |
boolean |
equals(java.lang.Object other)
Return true if this rule is equal to the supplied one.
|
static java.util.List<FPGrowth.AssociationRule> |
generateRulesBruteForce(weka.associations.FPGrowth.FrequentItemSets largeItemSets,
FPGrowth.AssociationRule.METRIC_TYPE metricToUse,
double metricThreshold,
int upperBoundMinSuppAsInstances,
int lowerBoundMinSuppAsInstances,
int totalTransactions)
Generate all association rules, from the supplied frequet item sets,
that meet a given minimum metric threshold.
|
java.util.Collection<FPGrowth.BinaryItem> |
getConsequence()
Get the consequence of this rule.
|
int |
getConsequenceSupport()
Get the support for the consequence.
|
FPGrowth.AssociationRule.METRIC_TYPE |
getMetricType()
Get the metric type of this rule (e.g.
|
double |
getMetricValue()
Get the value of the metric for this rule.
|
java.util.Collection<FPGrowth.BinaryItem> |
getPremise()
Get the premise of this rule.
|
int |
getPremiseSupport()
Get the support for the premise.
|
int |
getTotalSupport()
Get the total support for this rule (premise + consequence).
|
int |
getTotalTransactions()
Get the total number of transactions in the data.
|
static java.util.List<FPGrowth.AssociationRule> |
pruneRules(java.util.List<FPGrowth.AssociationRule> rulesToPrune,
java.util.ArrayList<Attribute> itemsToConsider,
boolean useOr) |
java.lang.String |
toString()
Get a textual description of this rule.
|
java.lang.String |
toXML() |
public static final Tag[] TAGS_SELECTION
public AssociationRule(java.util.Collection<FPGrowth.BinaryItem> premise, java.util.Collection<FPGrowth.BinaryItem> consequence, FPGrowth.AssociationRule.METRIC_TYPE metric, int premiseSupport, int consequenceSupport, int totalSupport, int totalTransactions)
premise
- the premise of the ruleconsequence
- the consequence of the rulemetric
- the metric for the rulepremiseSupport
- the support of the premiseconsequenceSupport
- the support of the consequencetotalSupport
- the total support of the ruletotalTransactions
- the number of transactions in the datapublic java.util.Collection<FPGrowth.BinaryItem> getPremise()
public java.util.Collection<FPGrowth.BinaryItem> getConsequence()
public FPGrowth.AssociationRule.METRIC_TYPE getMetricType()
public double getMetricValue()
public int getPremiseSupport()
public int getConsequenceSupport()
public int getTotalSupport()
public int getTotalTransactions()
public int compareTo(FPGrowth.AssociationRule other)
compareTo
in interface java.lang.Comparable<FPGrowth.AssociationRule>
other
- the rule to compare to.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean containsItems(java.util.ArrayList<Attribute> items, boolean useOr)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML()
public static java.util.List<FPGrowth.AssociationRule> generateRulesBruteForce(weka.associations.FPGrowth.FrequentItemSets largeItemSets, FPGrowth.AssociationRule.METRIC_TYPE metricToUse, double metricThreshold, int upperBoundMinSuppAsInstances, int lowerBoundMinSuppAsInstances, int totalTransactions)
largeItemSets
- the set of frequent item setsmetricToUse
- the metric to usemetricThreshold
- the threshold value that a rule must meetupperBoundMinSuppAsInstances
- the upper bound on the support
in order to accept the rulelowerBoundMinSuppAsInstances
- the lower bound on the support
in order to accept the ruletotalTransactions
- the total number of transactions in the datapublic static java.util.List<FPGrowth.AssociationRule> pruneRules(java.util.List<FPGrowth.AssociationRule> rulesToPrune, java.util.ArrayList<Attribute> itemsToConsider, boolean useOr)