<p>In <a href="https://github.com/mlpack/mlpack/pull/742#discussion_r72768144">src/mlpack/methods/preprocess/preprocess_describe_main.cpp</a>:</p>
<pre style='color:#555'>&gt; +
&gt; +      // Print statistics of the row i.
&gt; +      Log::Info &lt;&lt; boost::format(numberFormat)
&gt; +          % i
&gt; +          % arma::var(row, population)
&gt; +          % rowMean
&gt; +          % rowStd
&gt; +          % arma::median(row)
&gt; +          % rowMin
&gt; +          % rowMax
&gt; +          % (rowMax - rowMin) // range
&gt; +          % Skewness(row, rowStd, rowMean, population)
&gt; +          % Kurtosis(row, rowStd, rowMean, population)
&gt; +          % StandardError(row, rowStd) &lt;&lt; endl;
&gt; +    }
&gt; +  }
</pre>
<p>We can reduce some duplicate codes</p>

<pre><code>auto printStatResults = [&amp;](int dim)
{
    arma::rowvec row = data.row(dim);
    double rowMax = arma::max(row);
    double rowMin = arma::min(row);
    double rowMean = arma::mean(row);
    double rowStd = arma::stddev(row, population);

    // Print statistics of the given dimension.
    Log::Info &lt;&lt; boost::format(numberFormat)
        % dim
        % arma::var(row, population)
        % rowMean
        % rowStd
        % arma::median(row)
        % rowMin
        % rowMax
        % (rowMax - rowMin) // range
        % Skewness(row, rowStd, rowMean, population)
        % Kurtosis(row, rowStd, rowMean, population)
% StandardError(row, rowStd) &lt;&lt; endl;
};

if(CLI::HasParam("dimension")){
    printStatResults(dimension);
}else{
    for(size_t i = 0; i &lt; data.n_rows; ++i){
        printStatResults(i);
    }
}
</code></pre>

<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/742/files/27ac82e876c3d68637d9e72d28bf0dadbc229ace#r72768144">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFJR40peRLfNN-gLxfKMt0_JrCMyMks5qaczVgaJpZM4JWax8">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFN0BhgwboAmSwavZKdcaCkz3GFTNks5qaczVgaJpZM4JWax8.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/742/files/27ac82e876c3d68637d9e72d28bf0dadbc229ace#r72768144"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>