<p>Instead of using the dataset itself, this Train() function only needs the dataset statistics. This function works for 1-dimensional distributions only (you can only provide 1 number for each statistic).</p>

<p>This is useful for my code in LSHModel, where instead of using data to fit the distribution, we create a regression function that can predict the arithmetic and geometric mean of squared distances given the size of the dataset. Since we don't have the actual distances - we only have an estimation of the distances' statistics - we can't use the previous Train() function in GammaDistribution.</p>

<p>I modified my code so that the Train() that accepts the dataset simply calls this function for each row after computing the statistics, to avoid code reuse.</p>

<p>I also added a test to make sure this produces the same result as giving the Train() function the dataset.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/mlpack/mlpack/pull/748'>https://github.com/mlpack/mlpack/pull/748</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Adds a Train() function that only needs dataset statistics, not the dataset itself</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/mlpack/mlpack/pull/748/files#diff-0">src/mlpack/core/dists/gamma_distribution.cpp</a>
    (81)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/mlpack/mlpack/pull/748/files#diff-1">src/mlpack/core/dists/gamma_distribution.hpp</a>
    (15)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/mlpack/mlpack/pull/748/files#diff-2">src/mlpack/tests/distribution_test.cpp</a>
    (22)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/mlpack/mlpack/pull/748.patch'>https://github.com/mlpack/mlpack/pull/748.patch</a></li>
  <li><a href='https://github.com/mlpack/mlpack/pull/748.diff'>https://github.com/mlpack/mlpack/pull/748.diff</a></li>
</ul>

<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/748">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFET55vcK41g-nRWulJG6BIKFXSrpks5qb1P7gaJpZM4Jaqw0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFCaSy-TjE50N2vdSdzZdv9G8N22jks5qb1P7gaJpZM4Jaqw0.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/748"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>