diff options
author | Matthias <ilovemilk@wusa.io> | 2019-05-17 18:43:06 +0300 |
---|---|---|
committer | Matthias <ilovemilk@wusa.io> | 2019-05-17 18:43:06 +0300 |
commit | ca94620e473a5c3ec48e548fe3e40d0d103ec47f (patch) | |
tree | 6596853e2de7a24d1b0104fe3dd3ca8a8da15f4f /tests/Unit | |
parent | 8b22abc9a6c6ed29b54fe6ae480e670e2584353a (diff) |
add more standard deviation tests
Diffstat (limited to 'tests/Unit')
-rw-r--r-- | tests/Unit/Entropy/EntropyTest.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/Unit/Entropy/EntropyTest.php b/tests/Unit/Entropy/EntropyTest.php index c4f515d..2e74ecf 100644 --- a/tests/Unit/Entropy/EntropyTest.php +++ b/tests/Unit/Entropy/EntropyTest.php @@ -63,7 +63,9 @@ class EntropyTest extends TestCase public function dataSd() { $tests = []; - $tests[] = [[10, 2, 38, 23, 38, 23, 21], 13.284434]; + $tests[] = [[10, 2, 38, 23, 38, 23, 21], 12.298996]; + $tests[] = [[10, 12, 23, 23, 16, 23, 21, 16], 4.898979] + $tests[] = [[-5, 1, 8, 7, 2], 4.673328] return $tests; } @@ -76,7 +78,6 @@ class EntropyTest extends TestCase */ public function testSd($data, $sd) { - $this->assertEquals(number_format($this->invokePrivate($this->entropy, 'sd', [$data]), 6), $sd); $sum = 0.0; $mean = 0.0; $standardDeviation = 0.0; |