From b6fe290c65724827f4fc0d67e841b49fa92ac182 Mon Sep 17 00:00:00 2001 From: Arkadiusz Kondas Date: Mon, 12 Dec 2016 19:28:26 +0100 Subject: [PATCH] Fix for php7.1 accuracy test score --- tests/Phpml/Metric/AccuracyTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Phpml/Metric/AccuracyTest.php b/tests/Phpml/Metric/AccuracyTest.php index 13a255a..ef54002 100644 --- a/tests/Phpml/Metric/AccuracyTest.php +++ b/tests/Phpml/Metric/AccuracyTest.php @@ -50,6 +50,8 @@ class AccuracyTest extends \PHPUnit_Framework_TestCase $accuracy = Accuracy::score($dataset->getTestLabels(), $predicted); - $this->assertEquals(0.959, $accuracy, '', 0.01); + $expected = PHP_VERSION_ID >= 70100 ? 1 : 0.959; + + $this->assertEquals($expected, $accuracy, '', 0.01); } }