ca.pfv.spmf.algorithms.sequential_rules.cmrules
Class Rule
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequential_rules.cmrules.Rule
-
public class Rule extends java.lang.ObjectThis class represent a rule as found by the CMRules algorithm (an association rules as in Phase 1 of CMRules or a sequential rule as in phase 2 of CMRules. This class is specially designed for CMRules. It contains the "transactionCount" which is the support as defined in association rule mining, plus the "sequentialTransactionCount" which is the support as defined in sequential rule mining. Besides, each itemset (antecedent and consequent) carry their corresponding transaction ID lists (this is necessary for phase 2 of the CMRules algorithm).- See Also:
AlgoCMRules,Rules,Itemset
-
-
Constructor Summary
Constructors Constructor and Description Rule(Itemset itemset1, Itemset itemset2, int transactionCount, double confidence)ConstructorRule(Rule rule)Constructor by making a copy of a rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetAbsoluteSupport()Get the association support of this rule as a int.doublegetConfidence()Get the confidence.ItemsetgetItemset1()Get the rule antecedentItemsetgetItemset2()Get the rule consequentdoublegetRelativeSupport(int objectCount)Get relative association support of this rule.intgetSequentialAbsoluteSeqSupport()Get the sequential support of this rule.doublegetSequentialConfidence()Get the sequential confidence of this rule.doublegetSequentialSupport(int objectCount)Get the sequential support of this rule as a double, relative value.voidprint()Print the itemset to System.out.java.lang.StringtoString()Get a String representation of this rule.
-
-
-
Constructor Detail
-
Rule
public Rule(Itemset itemset1, Itemset itemset2, int transactionCount, double confidence)
Constructor- Parameters:
itemset1- antecedent itemsetitemset2- consequent itemsettransactionCount- association supportconfidence- confidence
-
Rule
public Rule(Rule rule)
Constructor by making a copy of a rule.- Parameters:
rule- a rule
-
-
Method Detail
-
getItemset1
public Itemset getItemset1()
Get the rule antecedent- Returns:
- an Itemset
-
getItemset2
public Itemset getItemset2()
Get the rule consequent- Returns:
- an Itemset
-
getRelativeSupport
public double getRelativeSupport(int objectCount)
Get relative association support of this rule.- Parameters:
objectCount- the database size.- Returns:
- a double value
-
getAbsoluteSupport
public int getAbsoluteSupport()
Get the association support of this rule as a int.- Returns:
- a int value.
-
getConfidence
public double getConfidence()
Get the confidence.- Returns:
- confidence as a double value.
-
print
public void print()
Print the itemset to System.out.
-
toString
public java.lang.String toString()
Get a String representation of this rule.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string
-
getSequentialAbsoluteSeqSupport
public int getSequentialAbsoluteSeqSupport()
Get the sequential support of this rule.- Returns:
- a int value.
-
getSequentialSupport
public double getSequentialSupport(int objectCount)
Get the sequential support of this rule as a double, relative value.- Returns:
- a double value.
-
getSequentialConfidence
public double getSequentialConfidence()
Get the sequential confidence of this rule.- Returns:
- a doule value.
-
-
DMelt 3.0 © DataMelt by jWork.ORG