|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<BitVector,AprioriResult>
de.lmu.ifi.dbs.elki.algorithm.APRIORI
public class APRIORI
Provides the APRIORI algorithm for Mining Association Rules.
Reference:
R. Agrawal, R. Srikant: Fast Algorithms for Mining Association Rules in Large Databases.
In Proc. 20th Int. Conf. on Very Large Data Bases (VLDB '94), Santiago de Chile, Chile 1994.
Field Summary | |
---|---|
private double |
minfreq
Holds the value of MINFREQ_PARAM . |
static OptionID |
MINFREQ_ID
OptionID for MINFREQ_PARAM |
private DoubleParameter |
MINFREQ_PARAM
Optional parameter to specify the threshold for minimum frequency, must be a double greater than or equal to 0 and less than or equal to 1. |
private int |
minsupp
Holds the value of MINSUPP_PARAM . |
static OptionID |
MINSUPP_ID
OptionID for MINSUPP_PARAM |
private IntParameter |
MINSUPP_PARAM
Parameter to specify the threshold for minimum support as minimally required number of transactions, must be an integer equal to or greater than 0. |
private AprioriResult |
result
The result. |
private Map<BitSet,Integer> |
support
Keeps the support of all evaluated bitsets. |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
APRIORI()
Provides the apriori algorithm, adding parameters MINFREQ_PARAM and
MINSUPP_PARAM to the option handler
additionally to parameters of super class. |
Method Summary | |
---|---|
protected BitSet[] |
frequentItemsets(BitSet[] candidates,
Database<BitVector> database)
Returns the frequent BitSets out of the given BitSets with respect to the given database. |
Description |
getDescription()
Returns a description of the algorithm. |
AprioriResult |
getResult()
Returns the result of the algorithm. |
protected BitSet[] |
join(BitSet[] frequentItemsets)
Returns a set of BitSets generated by joining pairs of given BitSets (relying on the given BitSets being sorted), increasing the length by 1. |
protected BitSet[] |
prune(BitSet[] candidates,
int size)
Prunes a given set of candidates to keep only those BitSets where all subsets of bits flipping one bit are frequent already. |
protected AprioriResult |
runInTime(Database<BitVector> database)
Performs the APRIORI algorithm on the given database. |
List<String> |
setParameters(List<String> args)
Calls the super method and sets additionally the values of the parameters MINFREQ_PARAM and MINSUPP_PARAM . |
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm |
---|
isTime, isVerbose, run, setTime, setVerbose |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription |
Field Detail |
---|
public static final OptionID MINFREQ_ID
MINFREQ_PARAM
private final DoubleParameter MINFREQ_PARAM
MINSUPP_PARAM
).
Key: -apriori.minfreq
private double minfreq
MINFREQ_PARAM
.
public static final OptionID MINSUPP_ID
MINSUPP_PARAM
private final IntParameter MINSUPP_PARAM
MINFREQ_PARAM
- setting MINSUPP_PARAM
is slightly preferable over setting
MINFREQ_PARAM
in terms of efficiency.
Key: -apriori.minsupp
private int minsupp
MINSUPP_PARAM
.
private AprioriResult result
private Map<BitSet,Integer> support
Constructor Detail |
---|
public APRIORI()
MINFREQ_PARAM
and
MINSUPP_PARAM
to the option handler
additionally to parameters of super class.
Method Detail |
---|
protected AprioriResult runInTime(Database<BitVector> database) throws IllegalStateException
runInTime
in class AbstractAlgorithm<BitVector,AprioriResult>
database
- the Database to run APRIORI on
IllegalStateException
- if the algorithm has not been initialized
properly (e.g. the setParameters(String[]) method has been failed
to be called).protected BitSet[] prune(BitSet[] candidates, int size)
candidates
- the candidates to be prunedsize
- size of the database
protected BitSet[] join(BitSet[] frequentItemsets)
frequentItemsets
- the BitSets to be joined
protected BitSet[] frequentItemsets(BitSet[] candidates, Database<BitVector> database)
candidates
- the candidates to be evaluateddatabase
- the database to evaluate the candidates on
public AprioriResult getResult()
Algorithm
public Description getDescription()
Algorithm
public List<String> setParameters(List<String> args) throws ParameterException
MINFREQ_PARAM
and MINSUPP_PARAM
.
setParameters
in interface Parameterizable
setParameters
in class AbstractAlgorithm<BitVector,AprioriResult>
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-setting
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |