Utilities
The following utilities often involve performing some combinatoric trick between Itemset
s and ARule
s, and might be useful to avoid reinventing the wheel.
Items and Itemsets
ModalAssociationRules.combine_items
— Functioncombine_items(itemsets::Vector{<:Itemset}, newlength::Integer)
Return a generator which combines Itemset
s from itemsets
into new itemsets of length newlength
by taking all combinations of two itemsets and joining them.
See also Itemset
.
combine_items(variable::Vector{<:Item}, fixed::Vector{<:Item})
Return a generator of Itemset
, which iterates the combinations of Item
s in variable
and prepend them to fixed
vector.
ModalAssociationRules.grow_prune
— Functiongrow_prune(candidates::Vector{Itemset}, frequents::Vector{Itemset}, k::Integer)
Return a generator, which yields only the candidates
for which every (k-1)-length subset is in frequents
.
See also Itemset
.
Missing docstring for coalesce_contributors(itemset::Itemset, miner::Miner; lmeas::Function=lsupport)
. Check Documenter's build log for details.
Association rules
ModalAssociationRules.generaterules
— Methodgeneraterules(itemsets::Vector{Itemset}, miner::Miner)
Raw subroutine of generaterules!(miner::Miner; kwargs...)
.
Generates ARule
from the given collection of itemsets
and miner
.
The strategy followed is described here at section 2.2.
To establish the meaningfulness of each association rule, check if it meets the global constraints specified in rulemeasures(miner)
, and yields the rule if so.
See also ARule
, Miner
, Itemset
, rulemeasures
.