<p>I agree, this is a nicer approach to the loading problem.  But I am a little concerned about speed: if we are loading the entire csv into <code>vector&lt;vector&lt;string&gt;&gt;</code>, this could mean lots of memory allocation if the dataset is of any significant size.  It's possible to do better with memory, by not storing the dataset entirely in memory: we read a row at a time, and if one of the dimensions has to be mapped, then we need to just read through the file again, getting the right columns, and applying the mappings and updating the matrix we have.  (If the matrix is not to be transposed, we only need to read through the row we are looking at.)</p>

<p>So it might be worth checking how long this takes on datasets that are, say, 100MB and make sure it does not take insanely long.  (Although realistically, if the user wants fast loading, they should not be using CSV!)</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/660#issuecomment-222792249">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFJ_q-Fq6EBsK97vLpOy9GP0lX662ks5qHIn5gaJpZM4Iq0a1">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFNL1YPHE3EG70wie9_EqJ-oU_HsTks5qHIn5gaJpZM4Iq0a1.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/660#issuecomment-222792249"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>