classinput__output__manager.html

来自「Aprior的C++实现算法」· HTML 代码 · 共 499 行 · 第 1/2 页

HTML
499
字号
<!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.5 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;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 &lt;<a class="el" href="Input__Output__Manager_8hpp-source.html">Input_Output_Manager.hpp</a>&gt;</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>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a0">Input_Output_Manager</a> (ifstream &amp;<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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a1">read_in_a_line</a> (set&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;basket)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads in one transaction from the basketfile.  <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned long&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a2">find_frequent_items</a> (ifstream &amp;mis_file, set&lt; pair&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a>, unsigned long &gt; &gt; &amp;support_of_items, vector&lt; double &gt; &amp;mis_abs)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines the frequent items, fills in the new_code an new_code_inverse vectors.  <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a3">basket_recode</a> (const set&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;original_basket, vector&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;new_basket)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates an other basket that contains only the frequent items recoded.  <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a4">write_out_basket</a> (const set&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;itemset)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes out an itemset to the output file.  <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#a5">write_out_basket_and_counter</a> (const set&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;itemset, const unsigned long counter)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes out an itemset and its counter to the output file.  <a href="#a5"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</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>&nbsp;</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 &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#r0">basket_file</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The file that contain the transactions.  <a href="#r0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>vector&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classInput__Output__Manager.html#r1">new_code</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The new codes of the frequent items.  <a href="#r1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>vector&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt;&nbsp;</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">&nbsp;</td><td class="mdescRight">The inverse of new_code vector.  <a href="#r2"></a><br><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#l00032">32</a> of file <a class="el" href="Input__Output__Manager_8hpp-source.html">Input_Output_Manager.hpp</a>.<hr><h2>Constructor &amp; 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">(&nbsp;</td>          <td class="md" nowrap valign="top">ifstream &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>basket_file</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const char *&nbsp;</td>          <td class="mdname" nowrap> <em>output_file_name</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00174">174</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">(&nbsp;</td>          <td class="md" nowrap valign="top">const set&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>original_basket</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>vector&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a> &gt; &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>new_basket</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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><em>original_basket</em>&nbsp;</td><td>The basket to filter and recode. </td></tr>    <tr><td valign=top><em>new_basket</em>&nbsp;</td><td>The created reduced basket </td></tr>  </table></dl><p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00138">138</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#l00069">new_code</a>.<p>Referenced by <a class="el" href="MSApriori_8cpp-source.html#l00021">MSApriori::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"> unsigned long Input_Output_Manager::find_frequent_items </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">ifstream &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>mis_file</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>set&lt; pair&lt; <a class="el" href="common_8hpp.html#a0">itemtype</a>, unsigned long &gt; &gt; &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>support_of_items</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>vector&lt; double &gt; &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>mis_abs</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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><em>mis_file</em>&nbsp;</td><td>The file that contain the relative mis values </td></tr>    <tr><td valign=top><em>support_of_items</em>&nbsp;</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>    <tr><td valign=top><em>mis_abs</em>&nbsp;</td><td>The absolut support thresholds according to the new coding </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of transactions that the basketfile contains.</dd></dl><p>Reading in mis values<p>Reading in relative mis values<p>Determining the support of the items<p>Filtering item, that do not need to consider. <p>Saving items and mis for item that need to be considered, and saving frequent items <p>Definition at line <a class="el" href="Input__Output__Manager_8cpp-source.html#l00057">57</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#l00022">itemtype</a>, <a class="el" href="Input__Output__Manager_8hpp-source.html#l00069">new_code</a>, <a class="el" href="Input__Output__Manager_8hpp-source.html#l00075">new_code_inverse</a>, and <a class="el" href="Input__Output__Manager_8cpp-source.html#l00025">read_in_a_line()</a>.<p>Referenced by <a class="el" href="MSApriori_8cpp-source.html#l00068">MSApriori::MSAPRIORI_alg()</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">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?