[mlpack-svn] r17482 - mlpack/tags/mlpack-1.0.11/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Dec 8 08:56:38 EST 2014
Author: rcurtin
Date: Mon Dec 8 08:56:38 2014
New Revision: 17482
Log:
Update test with trunk (somehow I did not merge it right).
Modified:
mlpack/tags/mlpack-1.0.11/src/mlpack/tests/logistic_regression_test.cpp
Modified: mlpack/tags/mlpack-1.0.11/src/mlpack/tests/logistic_regression_test.cpp
==============================================================================
--- mlpack/tags/mlpack-1.0.11/src/mlpack/tests/logistic_regression_test.cpp (original)
+++ mlpack/tags/mlpack-1.0.11/src/mlpack/tests/logistic_regression_test.cpp Mon Dec 8 08:56:38 2014
@@ -510,8 +510,11 @@
"1 2 3");
arma::vec responses("1 1 0");
- // Create a logistic regression object using SGD.
- LogisticRegression<SGD> lr(data, responses);
+ // Create a logistic regression object using a custom SGD object with a much
+ // smaller tolerance.
+ LogisticRegressionFunction lrf(data, responses, 0.001);
+ SGD<LogisticRegressionFunction> sgd(lrf, 0.01, 100000, 1e-10);
+ LogisticRegression<SGD> lr(sgd);
// Test sigmoid function.
arma::vec sigmoids = 1 / (1 + arma::exp(-lr.Parameters()[0]
@@ -600,7 +603,6 @@
// Ensure that the error is close to zero.
const double acc = lr.ComputeAccuracy(data, responses);
-
BOOST_REQUIRE_CLOSE(acc, 100.0, 0.3); // 0.3% error tolerance.
// Create a test set.
More information about the mlpack-svn
mailing list