ca.pfv.spmf.algorithms.associationrules.agrawal94_association_rules
Class AssocRules
- java.lang.Object
-
- ca.pfv.spmf.algorithms.associationrules.agrawal94_association_rules.AssocRules
-
public class AssocRules extends java.lang.ObjectThis class represents a list of association rules found by the Agrawal algorithm for association rule mining. It is used for storing the rules found by the algorithm, when the user choose to keep the result into memory rather than saving it to a file.- See Also:
AlgoAgrawalFaster94,AssocRule
-
-
Constructor Summary
Constructors Constructor and Description AssocRules(java.lang.String name)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddRule(AssocRule rule)Add a rule to this list of rulesjava.util.List<AssocRule>getRules()Get the list of rules.intgetRulesCount()Get the number of rules in this list of rulesvoidprintRules(int databaseSize)Print all the rules in this list to System.out.voidprintRulesWithLift(int databaseSize)Print all the rules in this list to System.out, and include information about the lift measure.voidsortByConfidence()Sort the rules by confidencejava.lang.StringtoString(int databaseSize)Return a string representation of this list of rules
-
-
-
Field Detail
-
rules
public final java.util.List<AssocRule> rules
-
-
Constructor Detail
-
AssocRules
public AssocRules(java.lang.String name)
Constructor- Parameters:
name- a name for this list of association rules (string)
-
-
Method Detail
-
sortByConfidence
public void sortByConfidence()
Sort the rules by confidence
-
printRules
public void printRules(int databaseSize)
Print all the rules in this list to System.out.- Parameters:
databaseSize- the number of transactions in the transaction database where the rules were found
-
printRulesWithLift
public void printRulesWithLift(int databaseSize)
Print all the rules in this list to System.out, and include information about the lift measure.- Parameters:
databaseSize- the number of transactions in the transaction database where the rules were found
-
toString
public java.lang.String toString(int databaseSize)
Return a string representation of this list of rules- Parameters:
databaseSize- the number of transactions in the database where the rules were found.- Returns:
- a string
-
addRule
public void addRule(AssocRule rule)
Add a rule to this list of rules- Parameters:
rule- the rule to be added
-
getRulesCount
public int getRulesCount()
Get the number of rules in this list of rules- Returns:
- the number of rules
-
getRules
public java.util.List<AssocRule> getRules()
Get the list of rules.- Returns:
- a list of rules.
-
-
DMelt 3.0 © DataMelt by jWork.ORG