Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Trie_hash Class Reference

#include <Trie_hash.hpp>

Inheritance diagram for Trie_hash:

Trie List of all members.

Public Member Functions

 Trie_hash (const itemtype child_threshold_in=5)
void statistics () const
 Displays the memory need of the trie.

void show_content () const
 Displays the trie.


Private Member Functions

void from_hash_to_normal (const unsigned long state_index)
 Alters a node from hash table to normal node.

void from_normal_to_hash (const unsigned long state_index)
 Alters a node from normal node to hash table.

void delete_edge (const unsigned long to_state)
 Deletes the edge that goes to a given state.

void max_path_set (const unsigned long state_index)
 Sets the maximal path value.

void add_empty_state (const unsigned long from_state, const itemtype item, const unsigned long counter)
 Adds an empty state to the trie.

unsigned long is_included (const set< itemtype > &an_itemset) const
 It decides whether the given itemset is included in the trie or not.

void delete_infrequent_one (const unsigned long min_occurrence)
 Deletes the nodes that represent infrequent itemsets of size 1.

void delete_infrequent_two (const unsigned long min_occurrence)
 Deletes the nodes that represent infrequent itemsets of size 2.

void delete_infrequent_more (const unsigned long min_occurrence)
 Deletes the nodes that represent infrequent itemsets.

void candidate_generation_assist (unsigned long actual_state, const itemtype distance_from_generator, set< itemtype > &maybe_candidate)
 Generates candidate of size more than two.

void find_candidate_more (const vector< itemtype > &basket, const itemtype distance_from_candidate, vector< itemtype >::const_iterator it_basket, const unsigned long actual_state, const unsigned long counter=1)
 Increases the counter for those itemsets that is contained by the given basket.

void assoc_rule_assist (ofstream &outcomefile, const double min_conf, unsigned long actual_state, set< itemtype > &consequence_part) const
void write_content_to_file_assist (ofstream &outcomefile, const unsigned long actual_state, const itemtype distance_from_frequent, set< itemtype > &frequent_itemset) const
 Writes out the content of the trie (frequent itemset and counters).


Private Attributes

vector< bool > type_vector
 It stores the type of the nodes.

itemtype child_threshold
 When the child number of a node is higher than child_threshold it is altered to hash table.

itemtype hash_modulus
 The modulus of the hash table.


Detailed Description

Author:
Ferenc Bodon


Constructor & Destructor Documentation

Trie_hash::Trie_hash const itemtype  child_threshold_in = 5  ) 
 


Member Function Documentation

void Trie_hash::add_empty_state const unsigned long  fromState,
const itemtype  item,
const unsigned long  counter
[private, virtual]
 

Adds an empty state to the trie.

Parameters:
fromState The state number that point to the new state.
item The label of the new edge
counter The initial counter of the new state

Reimplemented from Trie.

void Trie_hash::assoc_rule_assist ofstream &  outcomefile,
const double  min_conf,
unsigned long  actual_state,
set< itemtype > &  consequence_part
const [private, virtual]
 

Reimplemented from Trie.

void Trie_hash::candidate_generation_assist unsigned long  actual_state,
const itemtype  distance_from_generator,
set< itemtype > &  maybe_candidate
[private, virtual]
 

Generates candidate of size more than two.

Reimplemented from Trie.

void Trie_hash::delete_edge const unsigned long  toState  )  [private, virtual]
 

Deletes the edge that goes to a given state.

Parameters:
toState the state to the edge points.

Reimplemented from Trie.

void Trie_hash::delete_infrequent_more const unsigned long  min_occurrence  )  [private, virtual]
 

Deletes the nodes that represent infrequent itemsets.

Parameters:
min_occurrence The occurence threshold

Reimplemented from Trie.

void Trie_hash::delete_infrequent_one const unsigned long  min_occurrence  )  [private, virtual]
 

Deletes the nodes that represent infrequent itemsets of size 1.

Parameters:
min_occurrence The occurence threshold

Reimplemented from Trie.

void Trie_hash::delete_infrequent_two const unsigned long  min_occurrence  )  [private, virtual]
 

Deletes the nodes that represent infrequent itemsets of size 2.

Parameters:
min_occurrence The occurence threshold

temp_counter_array[stateIndex_1-1] will never be used again!

temp_counter_array will never be used again!

Reimplemented from Trie.

void Trie_hash::find_candidate_more const vector< itemtype > &  basket,
const itemtype  distance_from_candidate,
vector< itemtype >::const_iterator  it_basket,
const unsigned long  actual_state,
const unsigned long  counter = 1
[private, virtual]
 

Increases the counter for those itemsets that is contained by the given basket.

Parameters:
basket the given basket
distance_from_candidate The length of the path from the actual node to a node that represents a candidate
it_basket *it_basket lead to the actual_state. Only items following this item need to be considered
actual_state The index of the actual state
counter The number the processed basket occures in the transactional database

Reimplemented from Trie.

void Trie_hash::from_hash_to_normal const unsigned long  stateIndex  )  [private]
 

Alters a node from hash table to normal node.

Parameters:
stateIndex The node that has to be altered.

void Trie_hash::from_normal_to_hash const unsigned long  stateIndex  )  [private]
 

Alters a node from normal node to hash table.

Parameters:
stateIndex The node that has to be altered.

unsigned long Trie_hash::is_included const set< itemtype > &  an_itemset  )  const [private, virtual]
 

It decides whether the given itemset is included in the trie or not.

Parameters:
an_itemset The given itemset.
Returns:
0, if the itemset is not included, otherwise the state number, that represents the itemset.

Reimplemented from Trie.

void Trie_hash::max_path_set const unsigned long  stateIndex  )  [private, virtual]
 

Sets the maximal path value.

Parameters:
stateIndex the state whose max_path value has to be set.

Reimplemented from Trie.

void Trie_hash::show_content  )  const [virtual]
 

Displays the trie.

Reimplemented from Trie.

void Trie_hash::statistics  )  const [virtual]
 

Displays the memory need of the trie.

Reimplemented from Trie.

void Trie_hash::write_content_to_file_assist ofstream &  outcomefile,
const unsigned long  actual_state,
const itemtype  distance_from_frequent,
set< itemtype > &  frequent_itemset
const [private, virtual]
 

Writes out the content of the trie (frequent itemset and counters).

Reimplemented from Trie.


Member Data Documentation

itemtype Trie_hash::child_threshold [private]
 

When the child number of a node is higher than child_threshold it is altered to hash table.

itemtype Trie_hash::hash_modulus [private]
 

The modulus of the hash table.

Since hash tables have to be perfect the hash modulus equals the number of frequent items.

vector<bool> Trie_hash::type_vector [private]
 

It stores the type of the nodes.

If type_vector[i] is true, the ith node is an original node, otherwise it is a hash table.


The documentation for this class was generated from the following files:
Generated on Tue Mar 2 18:12:10 2004 for APRIORI algorithm by doxygen 1.3.5