[mlpack-svn] r11676 - mlpack/trunk/src/mlpack/tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Mar 1 00:54:13 EST 2012


Author: niche
Date: 2012-03-01 00:54:12 -0500 (Thu, 01 Mar 2012)
New Revision: 11676

Modified:
   mlpack/trunk/src/mlpack/tests/lars_test.cpp
Log:
fixed a bug in how we were checking the optimality conditions for the LASSO. holy shit, an error in the test case itself!

Modified: mlpack/trunk/src/mlpack/tests/lars_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/lars_test.cpp	2012-03-01 05:53:28 UTC (rev 11675)
+++ mlpack/trunk/src/mlpack/tests/lars_test.cpp	2012-03-01 05:54:12 UTC (rev 11676)
@@ -34,8 +34,8 @@
   {
     if (beta(j) == 0)
     {
-      // make sure that errCorr(j) <= lambda
-      BOOST_REQUIRE_SMALL(std::max(errCorr(j) - lambda, 0.0), tol);
+      // make sure that |errCorr(j)| <= lambda
+      BOOST_REQUIRE_SMALL(std::max(fabs(errCorr(j)) - lambda, 0.0), tol);
     }
     else if (beta(j) < 0)
     {




More information about the mlpack-svn mailing list