Turi Create
4.0
|
#include <toolkits/pattern_mining/fp_tree.hpp>
Public Member Functions | |
size_t | get_min_support_bound () |
size_t | get_min_depth () |
fp_top_k_tree | build_cond_tree (const fp_tree_heading &heading, size_t &min_support) const |
void | add_transaction (const std::vector< size_t > &new_transaction, const size_t &count) |
void | prune_tree (const size_t &min_support) |
std::vector< size_t > | get_supports_at_depth (const size_t &depth) const |
size_t | get_support (const fp_tree_heading &heading, const size_t &min_depth=1) const |
size_t | get_num_transactions () const |
std::vector< size_t > | get_descendant_supports (fp_node *anchor_node) |
fp_tree_header | get_cond_header (const fp_tree_heading &heading, const size_t &min_support) const |
std::vector< std::pair< size_t, size_t > > | get_cond_item_counts (const fp_tree_heading &heading) const |
fp_tree | build_cond_tree (const fp_tree_heading &heading, const size_t &min_support) const |
TOP-K FP-Tree data structure
Differs from a regular fp_tree in keeping track of a closed_node_count data structure to raise min_support
Vars: top_k - number of closed itemsets to mine (MINE_ALL returns all itemsets) min_length - minimum length of closed itemset support_count_map - map of support to number of closed nodes with support
http://web.engr.illinois.edu/~hanj/pdf/icdm02_topk.pdf http://hanj.cs.illinois.edu/pdf/tkde05_tfp.pdf
Definition at line 239 of file fp_tree.hpp.
|
virtual |
Add a transaction to the tree Args: new_transaction (vector of size_ts) - new itemset count (size_t) - repetitions of the transaction (should be positive)
Reimplemented from turi::pattern_mining::fp_tree.
|
inherited |
Construct the conditional fp-tree (fp-tree) for item id at the heading
The conditional fp-tree of item 'id' is the fp-tree constructed from transcations in the current fp-tree that contain more frequent items than 'id'.
Args: heading (fp_tree_heading) - the item heading of the conditional fp-tree min_support (size_t) - the minimum number of transactions required to be 'frequent'. Returns: cond_tree (fp_tree) - sorted vector of item ids.
fp_top_k_tree turi::pattern_mining::fp_top_k_tree::build_cond_tree | ( | const fp_tree_heading & | heading, |
size_t & | min_support | ||
) | const |
Modified methods to keep track of closed_node_count
|
inherited |
Get the header for a conditional fp-tree
The conditional fp-tree of item 'alpha' is the fp-tree constructed from transcations in the current fp-tree that contain more frequent items than 'alpha'. Note that only items with support greater than min_support (in the new subtree) are returned.
Args: heading (fp_tree_heading) - the item heading of the conditional fp-tree min_support (size_t) - the minimum number of transactions required to be 'frequent' Returns: cond_header (fp_tree-header) - header of conditional fp-tree
|
inherited |
Get the item frequencies for a conditional fp-tree
Args: heading (fp_tree_heading) - the item heading of the conditional fp-tree Returns: item_counts (vector of size_t, size_t) - Vector of item id and counts of the conditional fp-tree
|
inherited |
Get the supports of descendant node of an anchor node Args: anchor_node (pointer to fp_node) Returns: supports (vector of size_t) the supports of the children nodes This vector is used to raise min_support.
size_t turi::pattern_mining::fp_top_k_tree::get_min_depth | ( | ) |
Returns min_depth for a node to be in transaction of length min_length
size_t turi::pattern_mining::fp_top_k_tree::get_min_support_bound | ( | ) |
Get the min_support bound from closed_node_count
|
inherited |
Get total number of transactions in the current fp-tree.
|
inherited |
Get the support of the item in transactions below a depth
Args: heading (fp_tree_heading) - the item heading min_depth (size_t) - minimum depth in fp-tree (default is 1) Returns: support (size_t) the support (total count) of item id in the fp_tree (at min_depth)
|
inherited |
Get the support of all items at or below min_depth Args: min_depth (size_t) Returns: supports_at_depth (vector of size_t)
|
inherited |
Prune tree of items less than min_support Args: min_support (size_t) - new min_support to prune tree