Built in data structures
FPTree
ModalAssociationRules.FPTree
— Typemutable struct FPTree
content::Union{Nothing,Item} # Item contained in this node (nothing if root)
parent::Union{Nothing,FPTree} # parent node
const children::Vector{FPTree} # children nodes
count::Int64 # number of equal Items this node represents
link::Union{Nothing,FPTree} # link to another FPTree root
end
Fundamental data structure used in FP-Growth algorithm. Essentialy, an FPTree
is a prefix tree where a root-leaf path represent an Itemset
.
Consider the Itemset
s sorted by gsupport
of their items. An FPTree
is such that the common Item
s-prefix shared by different Itemset
s is not stored multiple times.
This implementation generalizes the propositional logic case scenario to modal logic; given two Itemset
s sharing a Item
prefix, the worlds in which they are true is accumulated.
Did you notice? One FPTree structure contains all the information needed to construct an EnhancedItemset
. This is crucial to generate new FPTree
s during fpgrowth algorithm, via building ConditionalPatternBase
iteratively while avoiding visiting the dataset over and over again.
See also EnhancedItemset
, fpgrowth
, gsupport
, Item
, Itemset
, WorldMask
.
ModalAssociationRules.content
— Methodcontent(fptree::FPTree)::Union{Nothing,Item}
Getter for the Item
(possibly empty) wrapped by fptree
.
ModalAssociationRules.content!
— Methodcontent!(fptree::FPTree, item::Union{Nothing,Item})
Setter for fptree
's content (the wrapped item).
ModalAssociationRules.parent
— Methodparent(fptree::FPTree)::Union{Nothing,FPTree}
Getter for the parent FPTree
s of fptree
.
ModalAssociationRules.parent!
— Methodparent!(fptree::FPTree, item::Union{Nothing,FPTree})
Setter for fptree
's parent FPTree
.
ModalAssociationRules.children
— Methodchildren(fptree::FPTree)::Vector{FPTree}
Getter for the list of children FPTree
s of fptree
.
ModalAssociationRules.children!
— Methodchildren!(fptree::FPTree, child::FPTree)
Add a new FPTree
to fptree
's children vector.
This method forces the new children to be added: it is a caller's responsability to check whether child
is not already a children of fptree
and, if so, handle the case. This check is performed, for example, in grow!
.
This method already sets the new children parent to fptree
itself.
Base.count
— MethodBase.count(fptree::FPTree)::Int64
Getter for the fptree
internal counter. Essentially, it represents the number of overlappings Item
which ended up in fptree
node during the building process of the tree itself.
ModalAssociationRules.count!
— Methodcount!(fptree::FPTree, newcount::Int64)
Setter for fptree
's internal counter to a fixed value newcount
.
ModalAssociationRules.addcount!
— Methodaddcount!(fptree::FPTree, newcount::Int64)
Add newcount
to fptree
's internal counter.
Missing docstring for contributors(fptree::FPTree)
. Check Documenter's build log for details.
Missing docstring for contributors!(fptree::FPTree, contribution::WorldMask)
. Check Documenter's build log for details.
Missing docstring for addcontributors!(fptree::FPTree, contribution::WorldMask)
. Check Documenter's build log for details.
Missing docstring for Base.push!(fptree::FPTree, itemset::Itemset, ninstance::Int64, miner::Miner; htable::Union{Nothing,HeaderTable}=nothing)
. Check Documenter's build log for details.
ModalAssociationRules.link
— Methodlink(fptree::FPTree)::Union{Nothing,FPTree}
Getter for fptree
's next brother FPTree
. fptree
's brotherhood is the set of all the FPTree
whose content is exactly fptree.content
.
ModalAssociationRules.link!
— Methodfunction link!(from::FPTree, to::FPTree)
Establish a link between two FPTree
s. If the starting tree is already linked with something, the already existing link are followed until a new "empty-linked" FPTree
is found.
See also follow
, FPTree
, HeaderTable
.
ModalAssociationRules.follow
— Methodfunction follow(fptree::FPTree)::Union{Nothing,FPTree}
Follow fptree
link to (an internal node of) another FPTree
.
See also FPTree
, HeaderTable
.
ModalAssociationRules.islist
— Methodislist(fptree::FPTree)::Bool
Return true if every subtree in fptree
has exactly 0 or 1 children.
See also FPTree
Missing docstring for retrieveall(fptree::FPTree)
. Check Documenter's build log for details.
Missing docstring for prune!(fptree::FPTree, miner::Miner)
. Check Documenter's build log for details.
HeaderTable
ModalAssociationRules.HeaderTable
— Typestruct HeaderTable
items::Vector{Item}
link::Dict{Item,Union{Nothing,FPTree}}
end
Utility data structure used to fastly access FPTree
internal nodes.
ModalAssociationRules.items
— Methoditems(htable::HeaderTable)::Vector{Item}
Getter for the Item
s loaded inside htable
.
See also HeaderTable
, Item
.
ModalAssociationRules.link
— Methodlink(htable::HeaderTable)
link(htable::HeaderTable, item::Item)
Getter for the link structure wrapped by htable
, or one of its specific entry.
The link structure is, essentially, a dictionary associating an Item
to a specific FPTree
.
See also FPTree
, HeaderTable
, Item
, link!
.
ModalAssociationRules.follow
— Methodfunction follow(htable::HeaderTable, item::Item)::Union{Nothing,FPTree}
Follow htable
link to (an internal node of) a FPTree
.
See also FPTree
, HeaderTable
, Item
, link
, link!
.
ModalAssociationRules.link!
— Methodfunction link!(htable::HeaderTable, fptree::FPTree)
Establish a link towards fptree
, follow
ing the entry in htable
corresponding to the content
of fptree
.
See also content
, FPTree
, HeaderTable
.
ModalAssociationRules.checksanity!
— Methodfunction checksanity!(htable::HeaderTable, miner::Miner)::Bool
Check if htable
internal state is correct, that is, its items
are sorted decreasingly by global support. If items
are already sorted, return true
; otherwise, sort them and return false
.
See also Miner
, gsupport
, HeaderTable
, items
.
Base.reverse
— MethodBase.reverse(htable::HeaderTable)
Iterator on htable
wrapped Item
s, in reverse order.
See also HeaderTable
, Item
.