From 7de55a3bf40d77332a10644eddb739aa93f8b18b Mon Sep 17 00:00:00 2001 From: Gabriele Sales Date: Wed, 12 Jul 2017 17:09:31 +0000 Subject: [PATCH] Fixed test for logistic regression, slope 1. Checks fail with the following log: ``` 1) test: LogisticRegressionTest::test_logistic_regression (F) line: 103 tests/logistic_regression_test.cpp assertion failed - Expression: abs(coeffs.at(1)-0.49)<0.01 - Example 2: Slope1 term doesn't match ``` According to the documentation the expected value for slope 1 is `-0.49` and the test should thus have the opposite sign. --- src/tests/logistic_regression_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/logistic_regression_test.cpp b/src/tests/logistic_regression_test.cpp index c92f103..dc4b7b8 100644 --- a/src/tests/logistic_regression_test.cpp +++ b/src/tests/logistic_regression_test.cpp @@ -100,7 +100,7 @@ void LogisticRegressionTest::test_logistic_regression() { coeffs.resize(n+1); logistic_regression(y, x, m, n, step_size, tol, epsabs, maxiter, &coeffs); CPPUNIT_ASSERT_MESSAGE("Example 2: Intercept term doesn't match", abs(coeffs.at(0)-0.34)<0.01); - CPPUNIT_ASSERT_MESSAGE("Example 2: Slope1 term doesn't match", abs(coeffs.at(1)-0.49)<0.01); + CPPUNIT_ASSERT_MESSAGE("Example 2: Slope1 term doesn't match", abs(coeffs.at(1)+0.49)<0.01); CPPUNIT_ASSERT_MESSAGE("Example 2: Slope2 term doesn't match", abs(coeffs.at(2)-0.13)<0.01); }