[mlpack] 77/207: Fix some DBSCAN implementation bugs.

Barak A. Pearlmutter barak+git at pearlmutter.net
Thu Mar 23 17:53:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

commit 58898484d6badde473e3023385ccf7d7c3f01b71
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Aug 10 16:08:17 2016 -0400

    Fix some DBSCAN implementation bugs.
---
 src/mlpack/methods/dbscan/dbscan_impl.hpp | 4 ++++
 src/mlpack/methods/dbscan/dbscan_main.cpp | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/dbscan/dbscan_impl.hpp b/src/mlpack/methods/dbscan/dbscan_impl.hpp
index a2caecc..ae78cfb 100644
--- a/src/mlpack/methods/dbscan/dbscan_impl.hpp
+++ b/src/mlpack/methods/dbscan/dbscan_impl.hpp
@@ -85,8 +85,10 @@ size_t DBSCAN<RangeSearchType, PointSelectionPolicy>::Cluster(
 
   std::vector<std::vector<size_t>> neighbors;
   std::vector<std::vector<double>> distances;
+  Log::Info << "Performing range search." << std::endl;
   rangeSearch.Train(data);
   rangeSearch.Search(data, math::Range(0.0, epsilon), neighbors, distances);
+  Log::Info << "Range search complete." << std::endl;
 
   // Initialize to all true; false means it's been visited.
   boost::dynamic_bitset<> unvisited(data.n_cols);
@@ -94,6 +96,8 @@ size_t DBSCAN<RangeSearchType, PointSelectionPolicy>::Cluster(
   while (unvisited.any())
   {
     const size_t nextIndex = pointSelector.Select(unvisited, data);
+    Log::Info << "Inspect point " << nextIndex << "; " << unvisited.count()
+        << " unvisited points remain." << std::endl;
 
     // currentCluster will only be incremented if a cluster was created.
     currentCluster = ProcessPoint(data, unvisited, nextIndex, assignments,
diff --git a/src/mlpack/methods/dbscan/dbscan_main.cpp b/src/mlpack/methods/dbscan/dbscan_main.cpp
index bba4a4c..92114b5 100644
--- a/src/mlpack/methods/dbscan/dbscan_main.cpp
+++ b/src/mlpack/methods/dbscan/dbscan_main.cpp
@@ -31,7 +31,7 @@ PARAM_INT_IN("min_size", "Minimum number of points for a cluster.", "m", 5);
 PARAM_STRING_IN("tree_type", "If using single-tree or dual-tree search, the "
     "type of tree to use ('kd', 'r', 'r-star', 'x', 'hilbert-r', 'r-plus', "
     "'r-plus-plus', 'cover', 'ball').", "t", "kd");
-PARAM_FLAG("single", "If set, single-tree range search (not dual-tree) "
+PARAM_FLAG("single_mode", "If set, single-tree range search (not dual-tree) "
     "will be used.", "S");
 PARAM_FLAG("naive", "If set, brute-force range search (not tree-based) "
     "will be used.", "N");
@@ -48,7 +48,7 @@ void RunDBSCAN(RangeSearchType rs = RangeSearchType())
   data::Load(CLI::GetParam<string>("input_file"), dataset);
 
   const double epsilon = CLI::GetParam<double>("epsilon");
-  const size_t minSize = (size_t) CLI::GetParam<size_t>("min_size");
+  const size_t minSize = (size_t) CLI::GetParam<int>("min_size");
 
   DBSCAN<RangeSearchType> d(epsilon, minSize, rs);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list