|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.PriorEstimation
Class implementing the prior estimattion of the predictive apriori algorithm for mining association rules. 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.
Constructor Summary | |
PriorEstimation(Instances instances,
int numRules,
int numIntervals,
boolean car)
Constructor |
Method Summary | |
RuleItem |
addCons(int[] itemArray)
generates a class association rule out of a given premise. |
void |
buildDistribution(double conf,
double length)
updates the distribution of the confidence values. |
double |
calculatePriorSum(boolean weighted,
double mPoint)
calculates the numerator and the denominator of the prior equation |
java.util.Hashtable |
estimatePrior()
Method to estimate the prior probabilities |
double |
findIntervall(double conf)
searches the mid point of the interval a given confidence value falls into |
void |
generateDistribution()
Calculates the prior distribution. |
double[] |
getMidPoints()
returns an ordered array of all mid points |
static double |
logbinomialCoefficient(int upperIndex,
int lowerIndex)
Method that calculates the base 2 logarithm of a binomial coefficient |
double |
midPoint(double size,
int number)
calculates the mid point of an interval |
void |
midPoints()
split the interval [0,1] into a predefined number of intervals and calculates their mid points |
int[] |
randomCARule(int maxLength,
int actualLength,
java.util.Random randNum)
Constructs an item set of certain length randomly. |
int[] |
randomRule(int maxLength,
int actualLength,
java.util.Random randNum)
Constructs an item set of certain length randomly. |
RuleItem |
splitItemSet(int premiseLength,
int[] itemArray)
splits an item set into premise and consequence and constructs therefore an association rule. |
void |
updateCounters(ItemSet itemSet)
updates the support count of an item set |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PriorEstimation(Instances instances, int numRules, int numIntervals, boolean car)
instances
- the instances to be used for generating the associationsnumRules
- the number of random rules used for generating the priornumIntervals
- the number of intervals to discretise [0,1]car
- flag indicating whether standard or class association rules are minedMethod Detail |
public final void generateDistribution() throws java.lang.Exception
java.lang.Exception
- if prior can't be estimated successfullypublic final int[] randomRule(int maxLength, int actualLength, java.util.Random randNum)
maxLength
- the number of attributes of the instancesactualLength
- the number of attributes that should be present in the item setrandNum
- the random number generator
public final int[] randomCARule(int maxLength, int actualLength, java.util.Random randNum)
maxLength
- the number of attributes of the instancesactualLength
- the number of attributes that should be present in the item setrandNum
- the random number generator
public final void buildDistribution(double conf, double length)
conf
- the confidence of the randomly created rulelength
- the legnth of the randomly created rulepublic final double findIntervall(double conf)
conf
- the confidence of a rule
public final double calculatePriorSum(boolean weighted, double mPoint)
weighted
- indicates whether the numerator or the denominator is calculatedmPoint
- the mid Point of an interval
public static final double logbinomialCoefficient(int upperIndex, int lowerIndex)
upperIndex
- upper Inedx of the binomial coefficientlowerIndex
- lower index of the binomial coefficient
public final java.util.Hashtable estimatePrior() throws java.lang.Exception
java.lang.Exception
- throws exception if the prior cannot be calculatedpublic final void midPoints()
public double midPoint(double size, int number)
size
- the size of each intervalnumber
- the number of the interval.
The intervals are numbered from 0 to m_numIntervals.
public final double[] getMidPoints()
public final RuleItem splitItemSet(int premiseLength, int[] itemArray)
premiseLength
- the length of the premiseitemArray
- a (randomly generated) item set
public final RuleItem addCons(int[] itemArray)
itemArray
- the (randomly constructed) premise of the class association rule
public final void updateCounters(ItemSet itemSet)
itemSet
- the item set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |