<p>In <a href="https://github.com/mlpack/mlpack/pull/699#discussion_r69017699">src/mlpack/core/tree/rectangle_tree/minimal_coverage_sweep_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +  std::vector&lt;SortStruct&lt;ElemType&gt;&gt; sorted(node-&gt;NumChildren());
&gt; +
&gt; +  for (size_t i = 0; i &lt; node-&gt;NumChildren(); i++)
&gt; +  {
&gt; +    sorted[i].d = SplitPolicy::Bound(node-&gt;Child(i))[axis].Hi();
&gt; +    sorted[i].n = i;
&gt; +  }
&gt; +  // Sort high bounds of children.
&gt; +  std::sort(sorted.begin(), sorted.end(), StructComp&lt;ElemType&gt;);
&gt; +
&gt; +  size_t splitPointer = fillFactor * node-&gt;NumChildren();
&gt; +
&gt; +  axisCut = sorted[splitPointer - 1].d;
&gt; +
&gt; +  // Check if the partition is suitable.
&gt; +  if (!CheckNonLeafSweep(node, axis, axisCut))
</pre>
<p>Why are you doing this check first before iterating over different values of <code>splitPointer</code>?  I guess I don't understand the reasoning.  It seems like this entire block of code is just to check that there does exist a valid split on this axis, so I guess the first <code>if</code> is just a shortcut to avoid checking every possible cut.  If by default you want to go with a midpoint split, you can hardcode the <code>0.5</code> and remove <code>fillFactor</code>, I agree with that.  But I guess if the default split does not work, you are trying all other possible splits until you find one that works?</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/699/files/e165d759f9ae612b9965f70fbbf8abdb19dc8d07#r69017699">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFHBAGiKE6iTuVzLnAm0gGOV-TpJEks5qQtDrgaJpZM4I3ATw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOAqjcKC3Ss1Ic67kCvuq86hNvwUks5qQtDrgaJpZM4I3ATw.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/699/files/e165d759f9ae612b9965f70fbbf8abdb19dc8d07#r69017699"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>