[mlpack-git] master: Properly consider all points to the left when hyperplane was not initialized. (72274e7)

gitdub at mlpack.org gitdub at mlpack.org
Sat Aug 6 11:43:17 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/0f4b25acd6aaa14294c044874ba6cc0751712baa...0a19d07bd39e6223991976474bc79671ba8aa0f0

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

commit 72274e75be1fe58fb68ed82060d125475f675ffd
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Sat Aug 6 12:43:17 2016 -0300

    Properly consider all points to the left when hyperplane was not initialized.


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

72274e75be1fe58fb68ed82060d125475f675ffd
 src/mlpack/core/tree/spill_tree/hyperplane.hpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/mlpack/core/tree/spill_tree/hyperplane.hpp b/src/mlpack/core/tree/spill_tree/hyperplane.hpp
index 9363371..8a459a2 100644
--- a/src/mlpack/core/tree/spill_tree/hyperplane.hpp
+++ b/src/mlpack/core/tree/spill_tree/hyperplane.hpp
@@ -81,8 +81,6 @@ class HyperplaneBase
   bool Left(const VecType& point,
             typename boost::enable_if<IsVector<VecType> >::type* = 0) const
   {
-    if (splitVal == DBL_MAX)
-      return 0;
     return Project(point) <= 0;
   };
 
@@ -96,8 +94,6 @@ class HyperplaneBase
   bool Right(const VecType& point,
             typename boost::enable_if<IsVector<VecType> >::type* = 0) const
   {
-    if (splitVal == DBL_MAX)
-      return 0;
     return Project(point) > 0;
   };
 
@@ -109,7 +105,7 @@ class HyperplaneBase
   bool Left(const BoundType& bound) const
   {
     if (splitVal == DBL_MAX)
-      return 0;
+      return true;
     return projVect.Project(bound).Hi() <= splitVal;
   };
 
@@ -121,7 +117,7 @@ class HyperplaneBase
   bool Right(const BoundType& bound) const
   {
     if (splitVal == DBL_MAX)
-      return 0;
+      return false;
     return projVect.Project(bound).Lo() > splitVal;
   };
 




More information about the mlpack-git mailing list