<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r69374855">src/mlpack/core/data/load_impl.hpp</a>:</p>
<pre style='color:#555'>&gt;  bool Load(const std::string&amp; filename,
&gt;            arma::Mat&lt;eT&gt;&amp; matrix,
&gt; -          MapperType&amp; info,
&gt; +          DatasetMapper&lt;PolicyType&gt;&amp; info,
&gt; +          PolicyType&amp; policy,
</pre>
<p>I think we should reduce duplicate codes, there are two solutions</p>

<p>1 : Use </p>

<pre><code>template&lt;typename eT, typename PolicyType&gt;
bool Load(const std::string&amp; filename,
                 arma::Mat&lt;eT&gt;&amp; matrix,
                 DatasetMapper&lt;PolicyType&gt;&amp; info,
                 PolicyType&amp; policy,
                 const bool fatal,
                 const bool transpose)
</code></pre>

<p>To implement </p>

<pre><code>template&lt;typename eT, typename PolicyType&gt;
bool Load(const std::string&amp; filename,
                 arma::Mat&lt;eT&gt;&amp; matrix,
                 DatasetMapper&lt;PolicyType&gt;&amp; info,                 
                 const bool fatal,
                 const bool transpose)
</code></pre>

<p>You can </p>

<pre><code>template&lt;typename eT, typename PolicyType&gt;
inline
bool Load(const std::string&amp; filename,
                 arma::Mat&lt;eT&gt;&amp; matrix,
                 DatasetMapper&lt;PolicyType&gt;&amp; info,                 
                 const bool fatal,
                 const bool transpose)
{
  Load(filename, matrix, info, PolicyType(), fatal, transpose);
}
</code></pre>

<p>2 : Add a new api in DatasetMapper</p>

<p><code>PolicyTypes const&amp; policy() const;</code></p>

<p>In this case, we do not need two functions, one function is enough, but the user need to store<br>
the policy in the DatasetMapper before they pass the DatasetMapper into the function.I think this<br>
way is more consistent.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/694/files/87d8d46396a42a4cd491b32be4f17e8582c9223d..de0b2dbba2422296d801e7aa60dc2ed06091ae1a#r69374855">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFET7RGQ4SxxMc1zjbAfabQv9DySCks5qRh4sgaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFKQhQ51cuEvp9OLYopbGGzRs1utfks5qRh4sgaJpZM4I07W-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/694/files/87d8d46396a42a4cd491b32be4f17e8582c9223d..de0b2dbba2422296d801e7aa60dc2ed06091ae1a#r69374855"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>