Skip to content

Commit

Permalink
add .coverage to git ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Jul 24, 2016
1 parent 6ed4761 commit 2a76cbb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
humbuglog.*
/bin/phpunit
.coverage
20 changes: 20 additions & 0 deletions tests/Phpml/Preprocessing/NormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,24 @@ public function testFitNotChangeNormalizerBehavior()

$this->assertEquals($normalized, $samples, '', $delta = 0.01);
}

public function testL1NormWithZeroSumCondition()
{
$samples = [
[0, 0, 0],
[2, 0, 0],
[0, 1, -1],
];

$normalized = [
[0.33, 0.33, 0.33],
[1.0, 0.0, 0.0],
[0.0, 0.5, -0.5],
];

$normalizer = new Normalizer(Normalizer::NORM_L1);
$normalizer->transform($samples);

$this->assertEquals($normalized, $samples, '', $delta = 0.01);
}
}

0 comments on commit 2a76cbb

Please sign in to comment.