17 #include <core/data/sframe/gl_sframe.hpp> 18 #include <core/data/sframe/gl_sarray.hpp> 20 #include <toolkits/feature_engineering/topk_indexer.hpp> 21 #include <toolkits/feature_engineering/statistics_tracker.hpp> 23 #include <toolkits/pattern_mining/fp_node.hpp> 24 #include <toolkits/pattern_mining/fp_tree_header.hpp> 27 namespace pattern_mining {
29 const size_t TOP_K_MAX = std::numeric_limits<size_t>::max();
45 std::shared_ptr<fp_node> root_node =
nullptr;
46 std::vector<size_t> root_prefix;
52 const std::vector<size_t>& prefix = std::vector<size_t>());
85 const size_t& min_depth = 1)
const;
108 virtual void add_transaction(
const std::vector<size_t>& new_transaction,\
109 const size_t& count);
128 const size_t& min_support)
const;
157 const size_t& min_support)
const;
191 const std::vector<std::pair<size_t,size_t>>& item_counts,\
192 const size_t& min_support);
202 std::vector<std::pair<size_t, size_t>> get_item_counts(
const gl_sarray& database);
214 std::vector<size_t> flex_to_id_vector(
const flexible_type& transaction_array);
219 std::ostream& operator<<(std::ostream& out,
const fp_tree& tree);
243 std::map<size_t, size_t> closed_node_count;
248 const size_t& k = TOP_K_MAX,
const size_t& length = 1, \
249 const std::vector<size_t>& prefix = std::vector<size_t>());
255 size_t get_min_support_bound();
261 size_t get_anchor_min_support_bound();
266 size_t get_min_depth();
272 size_t& min_support)
const;
274 const size_t& count);
275 void update_if_closed_node(
fp_node* node,
const size_t& count);
292 const size_t& top_k = TOP_K_MAX,
const size_t& min_length = 1);
297 size_t get_largest(std::vector<size_t> vec,
size_t k);
std::vector< size_t > get_supports_at_depth(const size_t &depth) const
void prune_tree(const size_t &min_support)
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
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
size_t get_num_transactions() const
virtual void add_transaction(const std::vector< size_t > &new_transaction, const size_t &count)
size_t get_support(const fp_tree_heading &heading, const size_t &min_depth=1) const