Skip to content

Commit 2a76cbb

Browse files
committed
add .coverage to git ignore
1 parent 6ed4761 commit 2a76cbb

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
humbuglog.*
33
/bin/phpunit
4+
.coverage

tests/Phpml/Preprocessing/NormalizerTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,24 @@ public function testFitNotChangeNormalizerBehavior()
7979

8080
$this->assertEquals($normalized, $samples, '', $delta = 0.01);
8181
}
82+
83+
public function testL1NormWithZeroSumCondition()
84+
{
85+
$samples = [
86+
[0, 0, 0],
87+
[2, 0, 0],
88+
[0, 1, -1],
89+
];
90+
91+
$normalized = [
92+
[0.33, 0.33, 0.33],
93+
[1.0, 0.0, 0.0],
94+
[0.0, 0.5, -0.5],
95+
];
96+
97+
$normalizer = new Normalizer(Normalizer::NORM_L1);
98+
$normalizer->transform($samples);
99+
100+
$this->assertEquals($normalized, $samples, '', $delta = 0.01);
101+
}
82102
}

0 commit comments

Comments
 (0)