<p>This is related to <a href="https://github.com/mlpack/mlpack/issues/290" class="issue-link" title="support arbitrary-precision types">#290</a> (that ticket references <a href="https://github.com/mlpack/mlpack/issues/300" class="issue-link" title="saving with higher precision">#300</a> but should reference <a href="https://github.com/mlpack/mlpack/issues/288" class="issue-link" title="allknn fails for mnist8m dataset">#288</a>; the incorrect reference is due to a semi-failed import from Trac...).  Basically, mlpack is currently hard-coded to work with doubles, but templatizing <code>MatType</code> for every class could allow arbitrary precisions and types (within the confines of what Armadillo provides).  That would be a ton of work, though, and the additional testing required would also be difficult to provide...</p>

<p>For now your best bet is probably to cast your data to <code>arma::mat</code>, then cast your resulting centroids back to <code>arma::Mat&lt;uint8_t&gt;</code>.</p>

<p>As for whether or not the clustering makes sense, yeah, it makes sense.  Even if the clustering was done in the <code>uint8_t</code> space I think it would converge fine.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/378#issuecomment-69590883">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFBwTEBovrq6bboy2ndZyROQvhVVNks5ng-VigaJpZM4DRNEs.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/issues/378#issuecomment-69590883"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>