public class DefaultAssociationRule extends AssociationRule implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
DefaultAssociationRule.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 |
---|
DefaultAssociationRule(java.util.Collection<Item> premise,
java.util.Collection<Item> consequence,
DefaultAssociationRule.METRIC_TYPE metric,
int premiseSupport,
int consequenceSupport,
int totalSupport,
int totalTransactions)
Construct a new default association rule.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Item> |
getConsequence()
Get the consequence of this rule.
|
int |
getConsequenceSupport()
Get the support for the consequence.
|
java.lang.String[] |
getMetricNamesForRule()
Return the names of the metrics available for this rule.
|
double[] |
getMetricValuesForRule()
Get all the available metric values for this rule.
|
double |
getNamedMetricValue(java.lang.String metricName)
Get the value of the named metric for this rule
|
int |
getNumberOfMetricsForRule()
Gets the number of metrics available for this rule.
|
java.util.Collection<Item> |
getPremise()
Get the premise of this rule.
|
int |
getPremiseSupport()
Get the support for the premise.
|
java.lang.String |
getPrimaryMetricName()
Get the name of the primary metric of this rule (e.g.
|
double |
getPrimaryMetricValue()
Get the value of the metric for this rule.
|
int |
getTotalSupport()
Get the total support for this rule (premise + consequence).
|
int |
getTotalTransactions()
Get the total number of transactions in the data.
|
java.lang.String |
toString()
Get a textual description of this rule.
|
compareTo, containsItems, equals
public static final Tag[] TAGS_SELECTION
public DefaultAssociationRule(java.util.Collection<Item> premise, java.util.Collection<Item> consequence, DefaultAssociationRule.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<Item> getPremise()
AssociationRule
getPremise
in class AssociationRule
public java.util.Collection<Item> getConsequence()
AssociationRule
getConsequence
in class AssociationRule
public java.lang.String getPrimaryMetricName()
AssociationRule
getPrimaryMetricName
in class AssociationRule
public double getPrimaryMetricValue()
AssociationRule
getPrimaryMetricValue
in class AssociationRule
public double getNamedMetricValue(java.lang.String metricName) throws java.lang.Exception
AssociationRule
getNamedMetricValue
in class AssociationRule
metricName
- the metric to get the value forjava.lang.Exception
- if the requested metric is unknown for this rulepublic int getNumberOfMetricsForRule()
AssociationRule
getNumberOfMetricsForRule
in class AssociationRule
public java.lang.String[] getMetricNamesForRule()
AssociationRule
getMetricNamesForRule
in class AssociationRule
public double[] getMetricValuesForRule() throws java.lang.Exception
AssociationRule
getMetricValuesForRule
in class AssociationRule
java.lang.Exception
- if a metric can't be computed for some reason.public int getPremiseSupport()
AssociationRule
getPremiseSupport
in class AssociationRule
public int getConsequenceSupport()
AssociationRule
getConsequenceSupport
in class AssociationRule
public int getTotalSupport()
AssociationRule
getTotalSupport
in class AssociationRule
public int getTotalTransactions()
AssociationRule
getTotalTransactions
in class AssociationRule
public java.lang.String toString()
toString
in class java.lang.Object