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::AbstractVector{<: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::AbstractVector{<:Item}, fixed::AbstractVector{<: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::AbstractVector{Itemset},
frequents::AbstractVector{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; localmeasure::Function=lsupport)
. Check Documenter's build log for details.
Association rules
ModalAssociationRules.generaterules
— Methodgeneraterules(itemsets::AbstractVector{Itemset}, miner::AbstractMiner)
Raw subroutine of generaterules!(miner::AbstractMiner; 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 arulemeasures(miner)
, and yields the rule if so.
See also AbstractMiner
, ARule
, Itemset
, arulemeasures
.
generaterules(itemsets::AbstractVector{Itemset}, miner::Miner)
See generaterules(::AbstractVector{Itemset}, ::AbstractMiner)
.