[mlpack-git] master: Make sure the split improves things. (21456cf)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Wed Dec 23 11:45:59 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/de9cc4b05069e1fa4793d9355f2f595af5ff45d2...6070527af14296cd99739de6c62666cc5d2a2125
>---------------------------------------------------------------
commit 21456cfb260766d09a6fee16cf0b0ba39876ff61
Author: Ryan Curtin <ryan at ratml.org>
Date: Thu Nov 5 14:33:52 2015 -0800
Make sure the split improves things.
>---------------------------------------------------------------
21456cfb260766d09a6fee16cf0b0ba39876ff61
src/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp b/src/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp
index d8193c8..7b279af 100644
--- a/src/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp
+++ b/src/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp
@@ -356,7 +356,8 @@ size_t HoeffdingTree<
}
// Are these far enough apart to split?
- if (largest - secondLargest > epsilon || numSamples > maxSamples)
+ if ((largest - secondLargest > epsilon) ||
+ ((numSamples > maxSamples) && (largest > 0.0)))
{
// Split!
splitDimension = largestIndex;
More information about the mlpack-git
mailing list