<p>I tried corel.csv.<br>
My implementation costs 44s</p>

<pre><code>�[0;32m[INFO ] �[0mProgram timers:
�[0;32m[INFO ] �[0m  clustering: 44.613388s
�[0;32m[INFO ] �[0m  computing_neighbors: 0.114881s
�[0;32m[INFO ] �[0m  loading_data: 7.664288s
�[0;32m[INFO ] �[0m  range_search/computing_neighbors: 37.602321s
�[0;32m[INFO ] �[0m  range_search/tree_building: 1.618025s
�[0;32m[INFO ] �[0m  saving_data: 0.639427s
�[0;32m[INFO ] �[0m  total_time: 52.928002s
�[0;32m[INFO ] �[0m  tree_building: 1.622805s
</code></pre>

<p>While scikit costs 10.5s.<br>
Result is the same.<br>
I think the bottleneck is range_search.<br>
I compare the range_search of mlpack with NearestNeighbors of scikit<br>
I save all queried vectors when performing MS into a means.csv and run query.</p>

<pre><code>  range::RangeSearch&lt;&gt; rangeSearcher(data, false, true);
  arma::mat tAllMean = allMean.t();
  tAllMean.save("means.csv", arma::csv_ascii);
  Timer::Start("search_test");
  for (size_t i = 0; i &lt; allMean.n_cols; ++i) {
    rangeSearcher.Search(allMean.unsafe_col(i), validRadius,
                         neighbors, distances);

  }
  Timer::Stop("search_test");
  timeval t = Timer::Get("search_test");
  std::cout &lt;&lt; t.tv_sec &lt;&lt; std::endl;
</code></pre>

<p>it costs 38s<br>
while in scikit,</p>

<pre><code>d = numpy.genfromtxt('/Users/HurricaneTong/GitHub/mlpack/build_MS_nondebug/bin/Debug/corel.csv', delimiter=',')
bw = estimate_bandwidth(d, quantile=0.2, n_samples=500)


means = numpy.genfromtxt('/Users/HurricaneTong/GitHub/mlpack/build_MS_nondebug/bin/Debug/means.csv', delimiter=',')
nbrs = NearestNeighbors(radius=bw).fit(d)
t1 = time.time()
for i in range(0, means.shape[0]):
    nbrs.radius_neighbors([means[i,:]], bw, return_distance=True)
t2 = time.time()
print t2 - t1
</code></pre>

<p>it costs 3.4s</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/pull/388#issuecomment-95480678">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFA3tw1MZDC6sDFEFbVugqudE-r5uks5oCJ2MgaJpZM4DTzb1.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/388#issuecomment-95480678"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>