[mlpack-git] master: Add 'ball' option for -t. (609fddb)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Oct 20 09:48:04 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/67e0a132c7f62820c734eb508fe1bc83128a3e13...00eccfdb0d315de3d94bfa1da84cc1dc65c8af39

>---------------------------------------------------------------

commit 609fddb1ee612b0d6e81a33af8737567502f82ce
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Oct 19 20:59:45 2015 +0000

    Add 'ball' option for -t.


>---------------------------------------------------------------

609fddb1ee612b0d6e81a33af8737567502f82ce
 src/mlpack/methods/neighbor_search/allknn_main.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/methods/neighbor_search/allknn_main.cpp b/src/mlpack/methods/neighbor_search/allknn_main.cpp
index f6d0413..18eae03 100644
--- a/src/mlpack/methods/neighbor_search/allknn_main.cpp
+++ b/src/mlpack/methods/neighbor_search/allknn_main.cpp
@@ -62,8 +62,8 @@ PARAM_INT("k", "Number of nearest neighbors to find.", "k", 0);
 
 // The user may specify the type of tree to use, and a few parameters for tree
 // building.
-PARAM_STRING("tree_type", "Type of tree to use: 'kd', 'cover', 'r', 'r-star'.",
-    "t", "kd");
+PARAM_STRING("tree_type", "Type of tree to use: 'kd', 'cover', 'r', 'r-star', "
+    "'ball'.", "t", "kd");
 PARAM_INT("leaf_size", "Leaf size for tree building (used for kd-trees, R "
     "trees, and R* trees).", "l", 20);
 PARAM_FLAG("random_basis", "Before tree-building, project the data onto a "
@@ -161,9 +161,11 @@ int main(int argc, char *argv[])
       tree = KNNModel::R_TREE;
     else if (treeType == "r-star")
       tree = KNNModel::R_STAR_TREE;
+    else if (treeType == "ball")
+      tree = KNNModel::BALL_TREE;
     else
       Log::Fatal << "Unknown tree type '" << treeType << "'; valid choices are "
-          << "'kd', 'cover', 'r', and 'r-star'." << endl;
+          << "'kd', 'cover', 'r', 'r-star', and 'ball'." << endl;
 
     knn.TreeType() = tree;
     knn.RandomBasis() = randomBasis;



More information about the mlpack-git mailing list