Package fim
Class SeqMine
java.lang.Object
fim.SeqMine
- All Implemented Interfaces:
Runnable
Class for mining (all/closed/maximal) frequent sequences.
- Since:
- 2017.06.26
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
the flag whether a mining run has been abortedstatic final int
target pattern subtype: closed frequent item patterns; to combined withSEQUENCE
static final int
operation mode: use a chain of prefix trees to filter for closed/maximal patternsstatic final int
operation mode: check for closed/maximal patterns via extensionsstatic final int
mask for operation mode flags concerning closed/maximal filteringstatic final int
operation mode: use a single prefix tree to filter for closed/maximal patternsstatic final int
mask for operation mode flags concerning closed/maximal filtering with a prefix tree repository (single tree or tree chain)static final String
the copyright information for this programstatic final int
operation mode: default settingstatic final String
the program descriptionstatic final double
the difference between 1.0 and the smallest number greater than 1.0 that is representable as a double precision number; used for handling rounding errorsstatic final int
target pattern subtype: simple frequent item patterns; to be combined withSEQUENCE
protected util.IdMap
the underlying item baseprotected int
the operation mode (DEFAULT
orREDUCE
, set byinitMining()
)protected double
the minimum support of an item pattern (set byinitMining()
)protected int
the target pattern type and subtype of the search (ITEMSET
orSEQUENCE
as the main target pattern type andFREQUENT
,CLOSED
orMAXIMAL
as the target pattern subtype)static final int
target pattern type: item sets (item order is ignored)protected int
the number of times an item may be used in a pattern (set byinitMining()
)protected int
the maximum length of an item pattern (number of items, set byinitMining()
)protected int
the minimum length of an item pattern (number of items, set byinitMining()
)static final int
target pattern subtype: maximal frequent item patterns; to be combined withSEQUENCE
protected int
the search/operation modestatic final int
operation mode: no special operation, identical toDEFAULT
protected PatternSet
the result set of frequent item patterns (item sequences)static final int
operation mode: force pre-check pruning for closed/maximal mining (attention: may lead to wrong results!)static final int
operation mode: reduce transaction suffix listsprotected int
the base support (support of empty sequence/database size)static final int
target pattern type: item sequenceprotected int
the minimum support of an item pattern (item sequence)static final int
target pattern subtype mask; to extract the target pattern subtype, that is,FREQUENT
,CLOSED
orMAXIMAL
protected TrActBag
the transactions to mine in a threaded mining runprotected int
the target pattern type and subtype of the searchstatic final int
target pattern type mask; to extract the main target pattern type, that is,ITEMSET
orSEQUENCE
static final String
the version of this programprotected int
the maximum length of an item pattern (number of items)protected int
the maximum length of an item pattern (number of items) that needs to be checked (zmax+1
if a closed/maximal filter is to be used, so that extensions are being checked, otherwise equal tozmax
)protected int
the minimum length of an item pattern (number of items) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
abort()
Abort a mining run.final void
clear()
Clear results of mining run.final PatternSet
Get result of a sequence mining run.final Thread
Get the thread that was started last (if any).final void
initMining
(TrActBag tabag, int target, double smin, int zmin, int zmax, int umax, int mode) Initialize mining frequent item patterns (sequences) in a thread.static void
Main function for command line use.final PatternSet
Find frequent item patterns (sequences).final PatternSet
Find frequent item sequences.final void
run()
Run mining (which must have been initialized withInitMining
).final Thread
Run mining as a thread (must have been initialized withInitMining
).
-
Field Details
-
DESCRIPTION
the program description- See Also:
-
VERSION
the version of this program- See Also:
-
COPYRIGHT
the copyright information for this program- See Also:
-
TYPEMASK
public static final int TYPEMASKtarget pattern type mask; to extract the main target pattern type, that is,ITEMSET
orSEQUENCE
- See Also:
-
SUBTYPEMASK
public static final int SUBTYPEMASKtarget pattern subtype mask; to extract the target pattern subtype, that is,FREQUENT
,CLOSED
orMAXIMAL
- See Also:
-
ITEMSET
public static final int ITEMSETtarget pattern type: item sets (item order is ignored)- See Also:
-
SEQUENCE
public static final int SEQUENCEtarget pattern type: item sequence- See Also:
-
FREQUENT
public static final int FREQUENTtarget pattern subtype: simple frequent item patterns; to be combined withSEQUENCE
- See Also:
-
CLOSED
public static final int CLOSEDtarget pattern subtype: closed frequent item patterns; to combined withSEQUENCE
- See Also:
-
MAXIMAL
public static final int MAXIMALtarget pattern subtype: maximal frequent item patterns; to be combined withSEQUENCE
- See Also:
-
DEFAULT
public static final int DEFAULToperation mode: default setting- See Also:
-
NONE
public static final int NONEoperation mode: no special operation, identical toDEFAULT
- See Also:
-
REDUCE
public static final int REDUCEoperation mode: reduce transaction suffix lists- See Also:
-
CMCHAIN
public static final int CMCHAINoperation mode: use a chain of prefix trees to filter for closed/maximal patterns- See Also:
-
CMTREE
public static final int CMTREEoperation mode: use a single prefix tree to filter for closed/maximal patterns- See Also:
-
CMEXTS
public static final int CMEXTSoperation mode: check for closed/maximal patterns via extensions- See Also:
-
CMTREEMASK
public static final int CMTREEMASKmask for operation mode flags concerning closed/maximal filtering with a prefix tree repository (single tree or tree chain)- See Also:
-
CMMASK
public static final int CMMASKmask for operation mode flags concerning closed/maximal filtering- See Also:
-
PREPRUNE
public static final int PREPRUNEoperation mode: force pre-check pruning for closed/maximal mining (attention: may lead to wrong results!)- See Also:
-
EPSILON
public static final double EPSILONthe difference between 1.0 and the smallest number greater than 1.0 that is representable as a double precision number; used for handling rounding errorsNote that this value differs from
double.EPSILON
, which is rather the smallest positive number that is representable as a double precision number.- See Also:
-
tabag
the transactions to mine in a threaded mining run -
itarget
protected int itargetthe target pattern type and subtype of the search (ITEMSET
orSEQUENCE
as the main target pattern type andFREQUENT
,CLOSED
orMAXIMAL
as the target pattern subtype) -
ismin
protected double isminthe minimum support of an item pattern (set byinitMining()
) -
izmin
protected int izminthe minimum length of an item pattern (number of items, set byinitMining()
) -
izmax
protected int izmaxthe maximum length of an item pattern (number of items, set byinitMining()
) -
imode
protected int imodethe operation mode (DEFAULT
orREDUCE
, set byinitMining()
) -
iumax
protected int iumaxthe number of times an item may be used in a pattern (set byinitMining()
) -
ibase
protected util.IdMap ibasethe underlying item base -
target
protected int targetthe target pattern type and subtype of the search -
smin
protected int sminthe minimum support of an item pattern (item sequence) -
sbase
protected int sbasethe base support (support of empty sequence/database size) -
zmin
protected int zminthe minimum length of an item pattern (number of items) -
zmax
protected int zmaxthe maximum length of an item pattern (number of items) -
zmaxx
protected int zmaxxthe maximum length of an item pattern (number of items) that needs to be checked (zmax+1
if a closed/maximal filter is to be used, so that extensions are being checked, otherwise equal tozmax
) -
mode
protected int modethe search/operation mode -
pats
the result set of frequent item patterns (item sequences) -
aborted
protected boolean abortedthe flag whether a mining run has been aborted
-
-
Constructor Details
-
SeqMine
public SeqMine()Create a miner for item patterns (frequent item sequences).- Since:
- 2017.06.26 (Christian Borgelt)
-
-
Method Details
-
mine
public final PatternSet mine(TrActBag tabag, int target, double smin, int zmin, int zmax, int umax, int mode) Find frequent item patterns (sequences).- Parameters:
tabag
- the (sequence) transactions to minetarget
- the type of frequent item patterns to mine (pattern typeSEQUENCE
and pattern subtypeFREQUENT
,CLOSED
orMAXIMAL
)smin
- the minimum support of an item pattern (positive: percentage, negative: absolute value)zmin
- the minimum size of an item pattern (number of items)zmax
- the maximum size of an item pattern (number of items)umax
- the maximum number of times an item may be used in a patternmode
- the operation mode (e.g.REDUCE
)- Returns:
- the found set of frequent item patterns
- Since:
- 2017.06.26 (Christian Borgelt)
-
mineSeq
public final PatternSet mineSeq(TrActBag tabag, int target, double smin, int zmin, int zmax, int umax, int mode) Find frequent item sequences.- Parameters:
tabag
- the (sequence) transactions to minetarget
- the type of frequent item sequences to mine (FREQUENT
,CLOSED
, orMAXIMAL
)smin
- the minimum support of an item sequence (positive: percentage, negative: absolute value)zmin
- the minimum size of an item sequence (number of items)zmax
- the maximum size of an item sequence (number of items)umax
- the maximum number of times an item may be used in a patternmode
- the operation mode (e.g.REDUCE
)- Returns:
- the found set of frequent item sequences
- Since:
- 2017.06.26 (Christian Borgelt)
-
initMining
public final void initMining(TrActBag tabag, int target, double smin, int zmin, int zmax, int umax, int mode) Initialize mining frequent item patterns (sequences) in a thread.- Parameters:
tabag
- the (sequence) transactions to minetarget
- the type of frequent item patterns to mine (pattern typeSEQUENCE
and pattern subtypeFREQUENT
,CLOSED
, orMAXIMAL
)smin
- the minimum support of an item pattern (positive: percentage, negative: absolute value)zmin
- the minimum size of an item pattern (number of items)zmax
- the maximum size of an item pattern (number of items)umax
- the number of times an item may be used in a patternmode
- the operation mode (e.g.REDUCE
)- Since:
- 2017.06.26 (Christian Borgelt)
-
run
public final void run()Run mining (which must have been initialized withInitMining
). The result can be retrieved withgetResult()
. -
runAsThread
Run mining as a thread (must have been initialized withInitMining
).The result can be retrieved with
getResult()
.- Returns:
- the created and started thread
- Since:
- 2017.06.26 (Christian Borgelt)
-
getThread
Get the thread that was started last (if any).- Returns:
- the thread that was started last
- Since:
- 2017.06.26 (Christian Borgelt)
-
abort
public final void abort()Abort a mining run.- Since:
- 2017.06.26 (Christian Borgelt)
-
getResult
Get result of a sequence mining run.- Returns:
- the sequence mining result
- Since:
- 2017.06.26 (Christian Borgelt)
-
clear
public final void clear()Clear results of mining run.- Since:
- 2017.06.26 (Christian Borgelt)
-
main
Main function for command line use.- Parameters:
args
- the command line arguments as an array of strings- Since:
- 2017.06.26 (Christian Borgelt)
-