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

Apriori_Trie.hpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Apriori_Trie.hpp  -  description
00003                              -------------------
00004     begin                : cs dec 26 2002
00005     copyright            : (C) 2002 by Ferenc Bodon
00006     email                : bodon@cs.bme.hu
00007  ***************************************************************************/
00008 
00009 #ifndef Apriori_Trie_HPP
00010 #define Apriori_Trie_HPP
00011 
00016 #include "Trie.hpp"
00017 #include "Input_Output_Manager.hpp"
00018 #include <fstream>
00019 #include <set>
00020 #include <vector>
00021 #include <cstdio>
00022 using namespace std;
00023 
00024 
00035 class Apriori_Trie
00036 {
00037 public:
00038 
00043    Apriori_Trie( const countertype counter_of_emptyset ):
00044       main_trie(counter_of_emptyset){}
00045    
00047    void insert_frequent_items(const vector<countertype>& counters );
00048    
00054    void candidate_generation( const itemtype& frequent_size,
00055                               Input_Output_Manager& input_output_manager );
00056 
00059    void find_candidate( const vector<itemtype>& basket, 
00060                         const itemtype candidate_size, 
00061                         const countertype counter=1 );
00062 
00064    void delete_infrequent( const double min_occurrence, 
00065                            const itemtype candidate_size );
00066 
00067 
00069    bool is_there_any_candidate() const
00070    {
00071       return !main_trie.edgevector.empty();
00072    }
00073 
00074    ~Apriori_Trie(){}
00075 
00076 protected:
00077 
00079    bool is_all_subset_frequent( const set<itemtype>& maybe_candidate ) const;
00080 
00082    void candidate_generation_two();
00083 
00085    void candidate_generation_assist( 
00086       Trie* trie, 
00087       set<itemtype>& maybe_candidate, 
00088       Input_Output_Manager& input_output_manager);
00089 
00091    void find_candidate_two( const vector<itemtype>& basket, 
00092                             const countertype counter=1 );
00093 
00095    void delete_infrequent_two( const double min_occurrence );
00096 
00097 private:
00098    // No private methods
00099 
00100 public:
00101    // No public members
00102 
00103 protected:
00105    Trie main_trie;
00106 
00113    vector< vector<countertype> > temp_counter_array;
00114 };
00115 
00116 #endif

Generated on Fri Mar 11 14:48:06 2005 for APRIORI algorithm by  doxygen 1.3.9.1