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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Sep 25 15:29:09 EDT 2013


Author: rcurtin
Date: Wed Sep 25 15:29:08 2013
New Revision: 15837

Log:
Use Sumedh's dataset for the perfect fit test.


Modified:
   mlpack/trunk/src/mlpack/tests/linear_regression_test.cpp

Modified: mlpack/trunk/src/mlpack/tests/linear_regression_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/linear_regression_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/linear_regression_test.cpp	Wed Sep 25 15:29:08 2013
@@ -88,12 +88,13 @@
 {
   // Linear regression should perfectly model this dataset.
   arma::mat predictors;
-  predictors << 0 << 1 << 2 << 3 << 4 << 5 << 6 << arma::endr;
-  arma::vec responses = "1 2 3 4 5 6 7";
+  predictors << 0 << 1 << 2 << 1 << 6 << 2 << arma::endr
+             << 0 << 1 << 2 << 2 << 2 << 6 << arma::endr;
+  arma::vec responses = "0 2 4 3 8 8";
 
   LinearRegression lr(predictors, responses);
 
-  BOOST_REQUIRE_SMALL(lr.ComputeError(predictors, responses), 1e-30);
+  BOOST_REQUIRE_SMALL(lr.ComputeError(predictors, responses), 1e-25);
 }
 
 BOOST_AUTO_TEST_SUITE_END();



More information about the mlpack-svn mailing list