Package fim
Class CloMaxFilter
java.lang.Object
fim.CloMaxFilter
Class for filter repository for closed and maximal item patterns.
The repository takes the form of a chain of
CloMaxTree
.- Since:
- 2016.10.24 /*--------------------------------------------------------------------
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
target pattern subtype: closed frequent item patterns; to be combined withSEQUENCE
int
the direction of the item orderstatic final int
target pattern subtype: simple frequent item patternsutil.IdMap
the underlying item basestatic final int
target pattern type: item sets (item order is ignored)static final int
target pattern subtype: maximal frequent item patterns; to be combined withSEQUENCE
static final int
target pattern type: paths represent (general) sequences (with and without repetition)int
the current number of prefix treesstatic final int
target pattern subtype mask; to extract the target pattern subtype, that is,CLOSED
orMAXIMAL
int
the target type of the filtering;SEQUENCE
as the main target pattern type and eitherFREQUENT
,CLOSED
orMAXIMAL
as the target pattern subtypethe chain of (conditional) prefix treesstatic final int
target pattern type mask; to extract the main target pattern type, that is,SEQUENCE
-
Constructor Summary
ConstructorsConstructorDescriptionCloMaxFilter
(util.IdMap ibase, int target) Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).CloMaxFilter
(util.IdMap ibase, int target, int dir) Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy). -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(int item) Add an item to the current prefix (involves projecting the last prefix tree to the item).final void
addItem
(int item) Add an item to the current prefix (involves projecting the last prefix tree to the item).final void
clear()
Clear the closed/maximal filter.final int
getSupp()
Get the support of the current prefix.final CloMaxTree
getTree()
Retrieve one of the prefix trees of the prefix tree chain.final CloMaxTree
getTree
(int index) Retrieve one of the prefix trees of the prefix tree chain.final void
remove()
Remove an item from the current prefix.final void
remove
(int cnt) Remove items from the current prefix.final void
Remove an item from the current prefix.final PatternSet
report()
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final PatternSet
report
(int s_base) Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final PatternSet
report
(int s_base, int zmin, int zmax) Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final PatternReceiver
report
(PatternReceiver patrec) Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final PatternReceiver
report
(PatternReceiver patrec, int s_base) Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final PatternReceiver
report
(PatternReceiver patrec, int s_base, int zmin, int zmax) Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).final boolean
update
(int[] items, int cnt, int supp) Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).final boolean
update
(int[] items, int cnt, int supp, boolean prune) Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).
-
Field Details
-
TYPEMASK
public static final int TYPEMASKtarget pattern type mask; to extract the main target pattern type, that is,SEQUENCE
- See Also:
-
SUBTYPEMASK
public static final int SUBTYPEMASKtarget pattern subtype mask; to extract the target pattern subtype, that is,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: paths represent (general) sequences (with and without repetition)- See Also:
-
FREQUENT
public static final int FREQUENTtarget pattern subtype: simple frequent item patterns- See Also:
-
CLOSED
public static final int CLOSEDtarget pattern subtype: closed frequent item patterns; to be combined withSEQUENCE
- See Also:
-
MAXIMAL
public static final int MAXIMALtarget pattern subtype: maximal frequent item patterns; to be combined withSEQUENCE
- See Also:
-
ibase
public util.IdMap ibasethe underlying item base -
target
public int targetthe target type of the filtering;SEQUENCE
as the main target pattern type and eitherFREQUENT
,CLOSED
orMAXIMAL
as the target pattern subtype -
dir
public int dirthe direction of the item order -
size
public int sizethe current number of prefix trees -
trees
the chain of (conditional) prefix trees
-
-
Constructor Details
-
CloMaxFilter
public CloMaxFilter(util.IdMap ibase, int target, int dir) Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).- Parameters:
ibase
- the underlying item basetarget
- the target pattern type of the prefix tree (main target pattern typeSEQUENCE
and target pattern subtypeCLOSED
orMAXIMAL
dir
- the direction of the item order- Since:
- 2017.06.22 (Christian Borgelt)
-
CloMaxFilter
public CloMaxFilter(util.IdMap ibase, int target) Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).- Parameters:
ibase
- the underlying item basetarget
- the target pattern type of the prefix tree (main target pattern typeSEQUENCE
and target pattern subtypeCLOSED
orMAXIMAL
- Since:
- 2017.06.22 (Christian Borgelt)
-
-
Method Details
-
clear
public final void clear()Clear the closed/maximal filter.- Since:
- 2017.06.22 (Christian Borgelt)
-
getSupp
public final int getSupp()Get the support of the current prefix.- Returns:
- the support of the current prefix
- Since:
- 2017.06.22 (Christian Borgelt)
-
getTree
Retrieve one of the prefix trees of the prefix tree chain.- Parameters:
index
- the index of the prefix tree to retrieve- Returns:
- the prefix tree with index
index
- Since:
- 2017.06.22 (Christian Borgelt)
-
getTree
Retrieve one of the prefix trees of the prefix tree chain.- Returns:
- the first prefix tree of the prefix tree chain
- Since:
- 2017.06.22 (Christian Borgelt)
-
add
public final void add(int item) Add an item to the current prefix (involves projecting the last prefix tree to the item).- Parameters:
item
- the item to add to the current prefix- Since:
- 2017.06.22 (Christian Borgelt)
-
addItem
public final void addItem(int item) Add an item to the current prefix (involves projecting the last prefix tree to the item).- Parameters:
item
- the item to add to the current prefix- Since:
- 2017.06.22 (Christian Borgelt)
-
remove
public final void remove(int cnt) Remove items from the current prefix.- Parameters:
cnt
- the number of items to remove from the current prefix- Since:
- 2017.06.22 (Christian Borgelt)
-
remove
public final void remove()Remove an item from the current prefix.- Since:
- 2017.06.22 (Christian Borgelt)
-
removeItem
public final void removeItem()Remove an item from the current prefix.- Since:
- 2017.06.22 (Christian Borgelt)
-
update
public final boolean update(int[] items, int cnt, int supp, boolean prune) Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).- Parameters:
items
- the item pattern to addcnt
- the number of items in the pattern to addsupp
- the support of the item pattern to addprune
- whether to prune sub- or super-patterns (depending on the target type) from the prefix tree- Returns:
- whether the given pattern was added to the filter
- Since:
- 2017.06.22 (Christian Borgelt)
-
update
public final boolean update(int[] items, int cnt, int supp) Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).- Parameters:
items
- the item pattern to addcnt
- the number of items in the pattern to addsupp
- the support of the item pattern to add- Returns:
- whether the given pattern was added to the filter
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Parameters:
s_base
- the base support (support of the empty item pattern); if-1
, the root node supportis used, if-2
, the item pattern support is usedzmin
- the minimum size of an item pattern (number of items)zmax
- the maximum size of an item pattern (number of items)- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Parameters:
s_base
- the base support (support of the empty item pattern); if-1
, the root node supportis used, if-2
, the item pattern support is used- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Parameters:
patrec
- the receiver for collecting the item patterns- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Parameters:
patrec
- the receiver for collecting the item patternss_base
- the base support (support of the empty item pattern); if-1
, the root node support is used, if-2
, the item pattern support is used- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-
report
Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).- Parameters:
patrec
- the receiver for collecting the item patternss_base
- the base support (support of the empty item pattern); if-1
, the root node support is used, if-2
, the item pattern support is usedzmin
- the minimum size of an item pattern (number of items)zmax
- the maximum size of an item pattern (number of items)- Returns:
- the set of closed or maximal item patterns
- Since:
- 2017.06.22 (Christian Borgelt)
-