Skip to content

Commit

Permalink
test exception on kmeans
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Jul 24, 2016
1 parent 448eaaf commit 403824d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Phpml/Exception/NormalizerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ public static function unknownNorm()
{
return new self('Unknown norm supplied.');
}

}
8 changes: 8 additions & 0 deletions tests/Phpml/Clustering/KMeansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ public function testKMeansInitializationMethods()
$clusters = $kmeans->cluster($samples);
$this->assertEquals(4, count($clusters));
}

/**
* @expectedException \Phpml\Exception\InvalidArgumentException
*/
public function testThrowExceptionOnInvalidClusterNumber()
{
new KMeans(0);
}
}

0 comments on commit 403824d

Please sign in to comment.