[mlpack-git] master: Try to keep the query and reference levels equal. (595ae21)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:03:50 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

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

commit 595ae211e25babebe2aadc250ef5edf596c91f78
Author: Ryan Curtin <ryan at ratml.org>
Date:   Thu Feb 5 15:31:38 2015 -0500

    Try to keep the query and reference levels equal.


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

595ae211e25babebe2aadc250ef5edf596c91f78
 src/mlpack/core/tree/binary_space_tree/dual_tree_traverser_impl.hpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/core/tree/binary_space_tree/dual_tree_traverser_impl.hpp b/src/mlpack/core/tree/binary_space_tree/dual_tree_traverser_impl.hpp
index 1a1d353..a226cc0 100644
--- a/src/mlpack/core/tree/binary_space_tree/dual_tree_traverser_impl.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/dual_tree_traverser_impl.hpp
@@ -67,7 +67,9 @@ DualTreeTraverser<RuleType>::Traverse(
       numBaseCases += referenceNode.Count();
     }
   }
-  else if ((!queryNode.IsLeaf()) && referenceNode.IsLeaf())
+  else if (((!queryNode.IsLeaf()) && referenceNode.IsLeaf()) ||
+           (queryNode.NumDescendants() > 3 * referenceNode.NumDescendants() &&
+            !queryNode.IsLeaf() && !referenceNode.IsLeaf()))
   {
     // We have to recurse down the query node.  In this case the recursion order
     // does not matter.



More information about the mlpack-git mailing list