[mlpack-git] master: Only serialize the necessary split. (8153570)

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


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

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

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

commit 81535708fb94d20a26e9388d4b134fb6f9feab13
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sat Oct 17 11:41:09 2015 -0400

    Only serialize the necessary split.


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

81535708fb94d20a26e9388d4b134fb6f9feab13
 src/mlpack/methods/hoeffding_trees/hoeffding_split_impl.hpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/hoeffding_trees/hoeffding_split_impl.hpp b/src/mlpack/methods/hoeffding_trees/hoeffding_split_impl.hpp
index c7df1fb..80b7548 100644
--- a/src/mlpack/methods/hoeffding_trees/hoeffding_split_impl.hpp
+++ b/src/mlpack/methods/hoeffding_trees/hoeffding_split_impl.hpp
@@ -398,10 +398,11 @@ void HoeffdingSplit<
   }
   else
   {
-    // We have split, so we only need to cache the numeric and categorical
-    // split.
-    ar & CreateNVP(categoricalSplit, "categoricalSplit");
-    ar & CreateNVP(numericSplit, "numericSplit");
+    // We have split, so we only need to save the split.
+    if (datasetInfo->Type(splitDimension) == data::Datatype::categorical)
+      ar & CreateNVP(categoricalSplit, "categoricalSplit");
+    else
+      ar & CreateNVP(numericSplit, "numericSplit");
 
     if (Archive::is_loading::value)
     {



More information about the mlpack-git mailing list