[mlpack-git] mlpack-1.0.x: Update test with trunk (somehow I did not merge it right). (7b561a8)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:07:41 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : mlpack-1.0.x
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 7b561a8ffb7f87213538a1f57600f6017b70b928
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Dec 8 13:56:38 2014 +0000
Update test with trunk (somehow I did not merge it right).
>---------------------------------------------------------------
7b561a8ffb7f87213538a1f57600f6017b70b928
src/mlpack/tests/logistic_regression_test.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/mlpack/tests/logistic_regression_test.cpp b/src/mlpack/tests/logistic_regression_test.cpp
index 69046f3..9db9328 100644
--- a/src/mlpack/tests/logistic_regression_test.cpp
+++ b/src/mlpack/tests/logistic_regression_test.cpp
@@ -510,8 +510,11 @@ BOOST_AUTO_TEST_CASE(LogisticRegressionSGDSimpleTest)
"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 @@ BOOST_AUTO_TEST_CASE(LogisticRegressionLBFGSGaussianTest)
// 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-git
mailing list