Available algorithms
Candidate generation based
ModalAssociationRules.apriori
— Functionapriori(miner::Miner; verbose::Bool=true)::Nothing
Apriori algorithm, as described here but generalized to also work with modal logic.
Arguments
miner::M
: miner containing the data and the extraction parameterization;prune_strategy::Function=grow_prune
: strategy to prune candidates between one iteration
and the successive;
verbose::Bool=false
: print informations about each iteration.
See also grow_prune
, Miner
, MineableData
.
TreeProjection based
FPGrowth
ModalAssociationRules.fpgrowth
— Functionfpgrowth(miner::AbstractMiner; verbose::Bool=true)::Nothing
(Modal) FP-Growth algorithm, as described here.
Arguments
miner
: miner containing the extraction parameterization;X
: data from which you want to mine association rules;parallel
: enable multi-threaded execution, usingThreads.nthreads()
threads;distributed
: enable multi-processing execution, withDistributed.nworkers()
processes;verbose
: print detailed informations while the algorithm runs.
Requirements
This implementation requires a custom Bulldozer
constructor capable of handling the given AbstractMiner
. In particular, the following dispatch must be implemented:
Bulldozer(miner::MyMinerType, ith_instance::Integer)
See also AbstractMiner
, Bulldozer
, FPTree
, HeaderTable
, SoleBase.AbstractDataset
FPGrowth algorithm relies on two data structures, FPTree
and HeaderTable
. To know more about them and their, please refer to the documentation here data-structures.
FPGrowth algorithm relies on the following two routines.
ModalAssociationRules.patternbase
— Methodpatternbase(
item::Item,
htable::HeaderTable,
miner::AbstractMiner
)::ConditionalPatternBase
Retrieve the ConditionalPatternBase
of fptree
based on item
.
The conditional pattern based on a FPTree
is the set of all the paths from the tree root to nodes containing item
(not included). Each of these paths is represented by an EnhancedItemset
.
The EnhancedItemset
s in the returned ConditionalPatternBase
are sorted decreasingly by gsupport
.
See also AbstractMiner
, ConditionalPatternBase
, EnhancedItemset
, fpgrowth
, FPTree
, Item
, Itemset
, WorldMask
.
ModalAssociationRules.projection
— Methodfunction projection(pbase::ConditionalPatternBase, miner::AbstractMiner)
Return respectively a FPTree
and a HeaderTable
starting from pbase
. An AbstractMiner
must be provided to guarantee the generated header table internal state is OK, that is, its items are sorted decreasingly by gsupport
.
See also ConditionalPatternBase
, FPTree
, gsupport
, HeaderTable
, AbstractMiner
.
Also, FPGrowth requires the Miner
to remember the worlds associated with the extracted frequent itemsets. To add this functionality, we can define a new dispatch of initminingstate
: it is automatically considered to enrich the miner, while building it together with fpgrowth
as mining algorithm.
ModalAssociationRules.initminingstate
— Methodinitminingstate(::typeof(fpgrowth), ::MineableData)::MiningState
MiningState
fields levereged when executing FP-Growth algorithm.
See also hasminingstate
, MiningState
, miningstate
.
Anchored semantics
ModalAssociationRules.anchored_semantics
— Functionanchored_semantics(miner::M; kwargs...)::M where {M<:AbstractMiner}
Logic to be executed before the the algorithm wrapped within the miner
; the goal is to make such an algorithm coherent with anchored semantics.
ModalAssociationRules.anchored_apriori
— Functionanchored_apriori(miner::AbstractMiner; kwargs...)::Nothing
Anchored version of apriori
algorithm, that is exactly apriori
but assuring that miner
possess atleast isanchored_itemset
policy, with ignoreuntillength
parameter set to 1 or higher.
TODO - insert a reference to TIME2025 article.
See also AbstractMiner
, anchored_semantics
, apriori
.
ModalAssociationRules.anchored_fpgrowth
— Functionfunction anchored_fpgrowth(miner::M; kwargs...)::M where {M<:AbstractMiner}
Implementation of fpgrowth
with anchored semantics. Essentially, Item
s are SoleData.VariableDistance
s wrapping motifs.
More information about motifs: <insert-link> More information about the implementation: <insert-link>
See also AbstractMiner
, anchored_semantics
, 'fpgrowth`.