📄 classinput__output__manager.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>APRIORI algorithm: Input_Output_Manager Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.9.1 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>Input_Output_Manager Class Reference</h1>This class is responsible for the input, output and recode operations. <a href="#_details">More...</a><p><code>#include <<a class="el" href="Input__Output__Manager_8hpp-source.html">Input_Output_Manager.hpp</a>></code><p><a href="classInput__Output__Manager-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a0">Input_Output_Manager</a> (ifstream &<a class="el" href="classInput__Output__Manager.html#r0">basket_file</a>, const char *output_file_name)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a1">read_in_a_line</a> (set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &basket)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Reads in one transaction from the basketfile. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="common_8hpp.html#a1">countertype</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a2">find_frequent_items</a> (const double min_supp, vector< <a class="el" href="common_8hpp.html#a1">countertype</a> > &support_of_items)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Determines the frequent items, fills in the new_code an new_code_inverse vectors. <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a3">basket_recode</a> (const set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &original_basket, vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &new_basket)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an other basket that contains only the frequent items recoded. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a4">write_out_basket</a> (const set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &itemset)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Writes out an itemset to the output file. <a href="#a4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a5">write_out_basket_and_counter</a> (const set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > &itemset, const <a class="el" href="common_8hpp.html#a1">countertype</a> counter)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Writes out an itemset and its counter to the output file. <a href="#a5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a6">rewind</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#a7">~Input_Output_Manager</a> ()</td></tr><tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">ifstream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#r0">basket_file</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">The file that contain the transactions (i.e baskets). <a href="#r0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#r1">new_code</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">The new codes of the frequent items. <a href="#r1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classInput__Output__Manager.html#r2">new_code_inverse</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">The inverse of new_code vector. <a href="#r2"></a><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class is responsible for the input, output and recode operations. <p>In frequent itemset mining (FIM) algorithms only frequent items are of interest. Hence it is useful to represent frequent items with integers: <em>1, 2, ..., n</em>, where <em>n</em> 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. <p><p>Definition at line <a class="el" href="Input__Output__Manager_8hpp-source.html#l00034">34</a> of file <a class="el" href="Input__Output__Manager_8hpp-source.html">Input_Output_Manager.hpp</a>.<hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="Input_Output_Manager::Input_Output_Manager"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">Input_Output_Manager::Input_Output_Manager </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">ifstream & </td> <td class="mdname" nowrap> <em>basket_file</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>output_file_name</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><dl compact><dt><b>Author:</b></dt><dd>Ferenc Bodon </dd></dl><p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00017">17</a> of file <a class="el" href="Input__Output__Manager_8cpp-source.html">Input_Output_Manager.cpp</a>. </td> </tr></table><a class="anchor" name="a7" doxytag="Input_Output_Manager::~Input_Output_Manager"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">Input_Output_Manager::~<a class="el" href="classInput__Output__Manager.html">Input_Output_Manager</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00158">158</a> of file <a class="el" href="Input__Output__Manager_8cpp-source.html">Input_Output_Manager.cpp</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a3" doxytag="Input_Output_Manager::basket_recode"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void Input_Output_Manager::basket_recode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > & </td> <td class="mdname" nowrap> <em>original_basket</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>vector< <a class="el" href="common_8hpp.html#a0">itemtype</a> > & </td> <td class="mdname" nowrap> <em>new_basket</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Creates an other basket that contains only the frequent items recoded. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>original_basket</em> </td><td>The basket to filter and recode. </td></tr> <tr><td valign="top"></td><td valign="top"><em>new_basket</em> </td><td>The created reduced basket </td></tr> </table></dl><p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00118">118</a> of file <a class="el" href="Input__Output__Manager_8cpp-source.html">Input_Output_Manager.cpp</a>.<p>References <a class="el" href="Input__Output__Manager_8hpp-source.html#l00074">new_code</a>.<p>Referenced by <a class="el" href="Apriori_8cpp-source.html#l00021">Apriori::support()</a>. </td> </tr></table><a class="anchor" name="a2" doxytag="Input_Output_Manager::find_frequent_items"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="common_8hpp.html#a1">countertype</a> Input_Output_Manager::find_frequent_items </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const double </td> <td class="mdname" nowrap> <em>min_supp</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>vector< <a class="el" href="common_8hpp.html#a1">countertype</a> > & </td> <td class="mdname" nowrap> <em>support_of_items</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Determines the frequent items, fills in the new_code an new_code_inverse vectors. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>min_supp</em> </td><td>The (relative) support threshold. </td></tr> <tr><td valign="top"></td><td valign="top"><em>support_of_items</em> </td><td>The support of the items. The i<sup>th</sup> least frequent item's support is given by support_of_items[i]. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of transactions that the basketfile contains.</dd></dl><p>Determining the support of the items<p>Finding the frequent items <p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00059">59</a> of file <a class="el" href="Input__Output__Manager_8cpp-source.html">Input_Output_Manager.cpp</a>.<p>References <a class="el" href="common_8hpp-source.html#l00032">countertype</a>, <a class="el" href="Input__Output__Manager_8hpp-source.html#l00074">new_code</a>, <a class="el" href="Input__Output__Manager_8hpp-source.html#l00080">new_code_inverse</a>, and <a class="el" href="Input__Output__Manager_8cpp-source.html#l00027">read_in_a_line()</a>. </td> </tr></table><a class="anchor" name="a1" doxytag="Input_Output_Manager::read_in_a_line"></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int Input_Output_Manager::read_in_a_line </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">set< <a class="el" href="common_8hpp.html#a0">itemtype</a> > & </td> <td class="mdname1" valign="top" nowrap> <em>basket</em> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -