类 RuleGeneration
java.lang.Object
weka.associations.RuleGeneration
- 所有已实现的接口:
Serializable
,RevisionHandler
- 直接已知子类:
CaRuleGeneration
Class implementing the rule generation procedure of the predictive apriori algorithm.
Reference: T. Scheffer (2001). Finding Association Rules That Trade Support
Optimally against Confidence. Proc of the 5th European Conf.
on Principles and Practice of Knowledge Discovery in Databases (PKDD'01),
pp. 424-435. Freiburg, Germany: Springer-Verlag.
The implementation follows the paper expect for adding a rule to the output of the n best rules. A rule is added if: the expected predictive accuracy of this rule is among the n best and it is not subsumed by a rule with at least the same expected predictive accuracy (out of an unpublished manuscript from T. Scheffer).
- 版本:
- $Revision: 1.4 $
- 作者:
- Stefan Mutter (mutter@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static boolean
aSubsumesB
(RuleItem a, RuleItem b) Methods that decides whether or not rule a subsumes rule b.static final double
binomialDistribution
(double accuracy, double ruleCount, double premiseCount) calculates the probability using a binomial distribution.boolean
change()
Gets if the list fo the best rules has been changedint
count()
Gets the actual maximum value of the generation timestatic final double
expectation
(double ruleCount, int premiseCount, double[] midPoints, Hashtable priors) calculates the expected predctive accuracy of a rulegenerateRules
(int numRules, double[] midPoints, Hashtable priors, double expectation, Instances instances, TreeSet best, int genTime) Generates all rules for an item set.Returns the revision string.boolean
removeRedundant
(RuleItem toInsert) Method that removes redundant rules out of the list of the best rules.static FastVector
singleConsequence
(Instances instances, int attNum, FastVector consequences) generates a consequence of length 1 for an association rule.
-
构造器详细资料
-
RuleGeneration
Constructor- 参数:
itemSet
- item set for that rules should be generated. The item set will form the premise of the rules.
-
-
方法详细资料
-
binomialDistribution
public static final double binomialDistribution(double accuracy, double ruleCount, double premiseCount) calculates the probability using a binomial distribution. If the support of the premise is too large this distribution is approximated by a normal distribution.- 参数:
accuracy
- the accuracy valueruleCount
- the support of the whole rulepremiseCount
- the support of the premise- 返回:
- the probability value
-
expectation
public static final double expectation(double ruleCount, int premiseCount, double[] midPoints, Hashtable priors) calculates the expected predctive accuracy of a rule- 参数:
ruleCount
- the support of the rulepremiseCount
- the premise support of the rulemidPoints
- array with all mid pointspriors
- hashtable containing the prior probabilities- 返回:
- the expected predictive accuracy
-
generateRules
public TreeSet generateRules(int numRules, double[] midPoints, Hashtable priors, double expectation, Instances instances, TreeSet best, int genTime) Generates all rules for an item set. The item set is the premise.- 参数:
numRules
- the number of association rules the use wants to mine. This number equals the size n of the list of the best rules.midPoints
- the mid points of the intervalspriors
- Hashtable that contains the prior probabilitiesexpectation
- the minimum value of the expected predictive accuracy that is needed to get into the list of the best rulesinstances
- the instances for which association rules are generatedbest
- the list of the n best rules. The list is implemented as a TreeSetgenTime
- the maximum time of generation- 返回:
- all the rules with minimum confidence for the given item set
-
aSubsumesB
Methods that decides whether or not rule a subsumes rule b. The defintion of subsumption is: Rule a subsumes rule b, if a subsumes b AND a has got least the same expected predictive accuracy as b.- 参数:
a
- an association rule stored as a RuleItemb
- an association rule stored as a RuleItem- 返回:
- true if rule a subsumes rule b or false otherwise.
-
singleConsequence
public static FastVector singleConsequence(Instances instances, int attNum, FastVector consequences) generates a consequence of length 1 for an association rule.- 参数:
instances
- the instances under considerationattNum
- an item that does not occur in the premiseconsequences
- FastVector that possibly already contains other consequences of length 1- 返回:
- FastVector with consequences of length 1
-
removeRedundant
Method that removes redundant rules out of the list of the best rules. A rule is in that list if: the expected predictive accuracy of this rule is among the best and it is not subsumed by a rule with at least the same expected predictive accuracy- 参数:
toInsert
- the rule that should be inserted into the list- 返回:
- true if the method has changed the list, false otherwise
-
count
public int count()Gets the actual maximum value of the generation time- 返回:
- the actual maximum value of the generation time
-
change
public boolean change()Gets if the list fo the best rules has been changed- 返回:
- whether or not the list fo the best rules has been changed
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-