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

Input_Output_Manager Class Reference

This class is responsible for the input, output and recode operations. More...

#include <Input_Output_Manager.hpp>

List of all members.

Public Member Functions

 Input_Output_Manager (ifstream &basket_file, const char *output_file_name)
int read_in_a_line (set< itemtype > &basket)
 Reads in one transaction from the basketfile.

unsigned long find_frequent_items (ifstream &mis_file, set< pair< itemtype, unsigned long > > &support_of_items, vector< double > &mis_abs)
 Determines the frequent items, fills in the new_code an new_code_inverse vectors.

void basket_recode (const set< itemtype > &original_basket, vector< itemtype > &new_basket)
 Creates an other basket that contains only the frequent items recoded.

void write_out_basket (const set< itemtype > &itemset)
 Writes out an itemset to the output file.

void write_out_basket_and_counter (const set< itemtype > &itemset, const unsigned long counter)
 Writes out an itemset and its counter to the output file.

void rewind ()
 ~Input_Output_Manager ()

Private Attributes

ifstream & basket_file
 The file that contain the transactions.

vector< itemtypenew_code
 The new codes of the frequent items.

vector< itemtypenew_code_inverse
 The inverse of new_code vector.


Detailed Description

This class is responsible for the input, output and recode operations.

In frequent itemset mining (FIM) algorithms only frequent items are of interest. Hence it is useful to represent frequent items with integers: 1, 2, ..., n, where n is the number of frequent items. In the original transactional database, the items are also represented with integers, so we have to assign new integers to the frequent items.

Definition at line 32 of file Input_Output_Manager.hpp.


Constructor & Destructor Documentation

Input_Output_Manager::Input_Output_Manager ifstream &  basket_file,
const char *  output_file_name
 

Author:
Ferenc Bodon

Definition at line 17 of file Input_Output_Manager.cpp.

Input_Output_Manager::~Input_Output_Manager  ) 
 

Definition at line 174 of file Input_Output_Manager.cpp.


Member Function Documentation

void Input_Output_Manager::basket_recode const set< itemtype > &  original_basket,
vector< itemtype > &  new_basket
 

Creates an other basket that contains only the frequent items recoded.

Parameters:
original_basket The basket to filter and recode.
new_basket The created reduced basket

Definition at line 138 of file Input_Output_Manager.cpp.

References new_code.

Referenced by MSApriori::support().

unsigned long Input_Output_Manager::find_frequent_items ifstream &  mis_file,
set< pair< itemtype, unsigned long > > &  support_of_items,
vector< double > &  mis_abs
 

Determines the frequent items, fills in the new_code an new_code_inverse vectors.

Parameters:
mis_file The file that contain the relative mis values
support_of_items The support of the items. The ith least frequent item's support is given by support_of_items[i].
mis_abs The absolut support thresholds according to the new coding
Returns:
The number of transactions that the basketfile contains.

Reading in mis values

Reading in relative mis values

Determining the support of the items

Filtering item, that do not need to consider.

Saving items and mis for item that need to be considered, and saving frequent items

Definition at line 57 of file Input_Output_Manager.cpp.

References itemtype, new_code, new_code_inverse, and read_in_a_line().

Referenced by MSApriori::MSAPRIORI_alg().

int Input_Output_Manager::read_in_a_line set< itemtype > &  basket  ) 
 

Reads in one transaction from the basketfile.

Parameters:
basket The basket that will be filled with the next row of the file.
Returns:
0 if the end of file is reached, otherwise 1;

Definition at line 25 of file Input_Output_Manager.cpp.

References basket_file, and itemtype.

Referenced by find_frequent_items(), and MSApriori::support().

void Input_Output_Manager::rewind  ) 
 

Definition at line 168 of file Input_Output_Manager.cpp.

References basket_file.

Referenced by MSApriori::MSAPRIORI_alg().

void Input_Output_Manager::write_out_basket const set< itemtype > &  itemset  ) 
 

Writes out an itemset to the output file.

Definition at line 147 of file Input_Output_Manager.cpp.

References new_code_inverse.

Referenced by MSApriori_Trie::assoc_rule_find().

void Input_Output_Manager::write_out_basket_and_counter const set< itemtype > &  itemset,
const unsigned long  counter
 

Writes out an itemset and its counter to the output file.

Definition at line 156 of file Input_Output_Manager.cpp.

References new_code_inverse.

Referenced by MSApriori_Trie::write_content_to_file_assist().


Member Data Documentation

ifstream& Input_Output_Manager::basket_file [private]
 

The file that contain the transactions.

Definition at line 62 of file Input_Output_Manager.hpp.

Referenced by read_in_a_line(), and rewind().

vector<itemtype> Input_Output_Manager::new_code [private]
 

The new codes of the frequent items.

if new_code[i] is 0, then i is not frequent, otherwise the new code of item i is new_code[i]-1.

Definition at line 69 of file Input_Output_Manager.hpp.

Referenced by basket_recode(), and find_frequent_items().

vector<itemtype> Input_Output_Manager::new_code_inverse [private]
 

The inverse of new_code vector.

new_code_inverse[new_code[i]-1]=i if i is a frequent item.

Definition at line 75 of file Input_Output_Manager.hpp.

Referenced by find_frequent_items(), write_out_basket(), and write_out_basket_and_counter().


The documentation for this class was generated from the following files:
Generated on Sun Jun 20 23:41:08 2004 for APRIORI algorithm by doxygen 1.3.5