<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'>> bool Load(const std::string& filename,
> arma::Mat<eT>& matrix,
> - MapperType& info,
> + DatasetMapper<PolicyType>& info,
> + PolicyType& policy,
</pre>
<p>I think we should reduce duplicate codes, there are two solutions</p>
<p>1 : Use </p>
<pre><code>template<typename eT, typename PolicyType>
bool Load(const std::string& filename,
arma::Mat<eT>& matrix,
DatasetMapper<PolicyType>& info,
PolicyType& policy,
const bool fatal,
const bool transpose)
</code></pre>
<p>To implement </p>
<pre><code>template<typename eT, typename PolicyType>
bool Load(const std::string& filename,
arma::Mat<eT>& matrix,
DatasetMapper<PolicyType>& info,
const bool fatal,
const bool transpose)
</code></pre>
<p>You can </p>
<pre><code>template<typename eT, typename PolicyType>
inline
bool Load(const std::string& filename,
arma::Mat<eT>& matrix,
DatasetMapper<PolicyType>& 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& 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;">—<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>