[mlpack-svn] r16342 - in mlpack/trunk/src/mlpack: methods/det tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Sat Mar 1 14:37:19 EST 2014


Author: rcurtin
Date: Sat Mar  1 14:37:19 2014
New Revision: 16342

Log:
The maxLeafSize parameter is unused (other than an assert) so remove it
entirely.


Modified:
   mlpack/trunk/src/mlpack/methods/det/dtree.cpp
   mlpack/trunk/src/mlpack/methods/det/dtree.hpp
   mlpack/trunk/src/mlpack/tests/det_test.cpp

Modified: mlpack/trunk/src/mlpack/methods/det/dtree.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/det/dtree.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/det/dtree.cpp	Sat Mar  1 14:37:19 2014
@@ -130,7 +130,6 @@
                       double& splitValue,
                       double& leftError,
                       double& rightError,
-                      const size_t maxLeafSize,
                       const size_t minLeafSize) const
 {
   // Ensure the dimensionality of the data is the same as the dimensionality of
@@ -172,9 +171,6 @@
     // Sort the values in ascending order.
     dimVec = arma::sort(dimVec);
 
-    // Get ready to go through the sorted list and compute error.
-    assert(dimVec.n_elem > maxLeafSize);
-
     // Find the best split for this dimension.  We need to figure out why
     // there are spikes if this minLeafSize is enforced here...
     for (size_t i = minLeafSize - 1; i < dimVec.n_elem - minLeafSize; ++i)
@@ -297,8 +293,7 @@
     size_t dim;
     double splitValueTmp;
     double leftError, rightError;
-    if (FindSplit(data, dim, splitValueTmp, leftError, rightError, maxLeafSize,
-        minLeafSize))
+    if (FindSplit(data, dim, splitValueTmp, leftError, rightError, minLeafSize))
     {
       // Move the data around for the children to have points in a node lie
       // contiguously (to increase efficiency during the training).

Modified: mlpack/trunk/src/mlpack/methods/det/dtree.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/det/dtree.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/det/dtree.hpp	Sat Mar  1 14:37:19 2014
@@ -295,7 +295,6 @@
                  double& splitValue,
                  double& leftError,
                  double& rightError,
-                 const size_t maxLeafSize = 10,
                  const size_t minLeafSize = 5) const;
 
   /**

Modified: mlpack/trunk/src/mlpack/tests/det_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/det_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/det_test.cpp	Sat Mar  1 14:37:19 2014
@@ -108,7 +108,7 @@
 
   testDTree.logVolume = log(7.0) + log(4.0) + log(7.0);
   BOOST_REQUIRE(testDTree.FindSplit(testData, obDim, obSplit, obLeftError,
-      obRightError, 2, 1));
+      obRightError, 1));
 
   BOOST_REQUIRE(trueDim == obDim);
   BOOST_REQUIRE_CLOSE(trueSplit, obSplit, 1e-10);



More information about the mlpack-svn mailing list