[mlpack-git] master: Actually create the correct number of children. (33bb754)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Dec 23 11:42:16 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/de9cc4b05069e1fa4793d9355f2f595af5ff45d2...6070527af14296cd99739de6c62666cc5d2a2125

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

commit 33bb7546bbc74579ca121d554baaddd4d5111ed0
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Sep 22 07:01:51 2015 -0700

    Actually create the correct number of children.


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

33bb7546bbc74579ca121d554baaddd4d5111ed0
 .../methods/hoeffding_trees/hoeffding_categorical_split_impl.hpp      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/methods/hoeffding_trees/hoeffding_categorical_split_impl.hpp b/src/mlpack/methods/hoeffding_trees/hoeffding_categorical_split_impl.hpp
index c489799..599dcf0 100644
--- a/src/mlpack/methods/hoeffding_trees/hoeffding_categorical_split_impl.hpp
+++ b/src/mlpack/methods/hoeffding_trees/hoeffding_categorical_split_impl.hpp
@@ -47,7 +47,9 @@ void HoeffdingCategoricalSplit<FitnessFunction>::CreateChildren(
     SplitInfo& splitInfo)
 {
   // We'll make one child for each category.
-  children.push_back(StreamingDecisionTreeType(datasetInfo));
+  for (size_t i = 0; i < sufficientStatistics.n_cols; ++i)
+    children.push_back(StreamingDecisionTreeType(datasetInfo));
+
   // Create the according SplitInfo object.
   splitInfo = SplitInfo(sufficientStatistics.n_cols);
 }



More information about the mlpack-git mailing list